Restricted
Board Regular
- Joined
- Aug 9, 2014
- Messages
- 76
How would you best go about auto fitting column width?
I am using a sub procedure to insert new row(s), contingent on the user's input, into a worksheet, however it would be nice to have the data to be completely visible after the row(s) has been inserted.
I suppose this also needs to be done every time a new row is inserted, rather than just once, blatantly because new data could be longer than previous data entered.
So far, I have thought to use this:
Columns().AutoFit
It also appears as though both of these are different in nature, how do I be judicious about which to use?
Columns("A:H").AutoFit
Range("A1:H1").Columns.AutoFit
I have also heard the use of the Excel VBA 'EntireRow' property, would this help in any way?
I am using a sub procedure to insert new row(s), contingent on the user's input, into a worksheet, however it would be nice to have the data to be completely visible after the row(s) has been inserted.
I suppose this also needs to be done every time a new row is inserted, rather than just once, blatantly because new data could be longer than previous data entered.
So far, I have thought to use this:
Columns().AutoFit
It also appears as though both of these are different in nature, how do I be judicious about which to use?
Columns("A:H").AutoFit
Range("A1:H1").Columns.AutoFit
I have also heard the use of the Excel VBA 'EntireRow' property, would this help in any way?