Working with the Used Range : UsedRange « Access « VBA / Excel / Access / Word






Working with the Used Range

 
Sub auto()
    ActiveSheet.UsedRange.Columns.AutoFit
End Sub


 








Related examples in the same category

1.Loop through all used range
2.Remove extraneous rows and columns and reset the last cell
3.Using the SpecialCells method to select all the blanks in this range is one way to quickly fill in all the blank region cells with the region found above them:
4.Using the Areas Collection to Return a Noncontiguous Range