Programmatic (VBA) equivalent

Martyh

Registered User.
Local time
Today, 02:05
Joined
May 2, 2000
Messages
196
Hi there,

Is there a programmatic (VBA) equivalent to: double-clicking at the top of a column when the entire work sheet is selected, making all of the columns automatically change to perfect column width? Been looking for a couple of hours!! :banghead:

Regards,

Marty H.
 
My usual trick is to record a macro performing the desired process and then examine/adapt the code produced by the macro.
 
Thanks Paul I'll try that!!

Regards,

Marty
 
Happy to help Marty!
 
There is an auto fit command so
Activesheet.Columns.Autofit

But note that this does not apply to numeric data, I think.

Brian
 
Decided that I couldn't leave it like that so had a quick play.
If the cells had been formatted as number then overfilled cells give ##### and they will be enlarged to contain the number, if however no formatting given before the data is entered then a too large number will be changed to exponential and the cell will not be changed.

Brian
 

Users who are viewing this thread

Back
Top Bottom