Programmatic (VBA) equivalent (1 Viewer)

Martyh

Registered User.
Local time
Today, 10:48
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.
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 07:48
Joined
Aug 30, 2003
Messages
36,127
My usual trick is to record a macro performing the desired process and then examine/adapt the code produced by the macro.
 

Martyh

Registered User.
Local time
Today, 10:48
Joined
May 2, 2000
Messages
196
Thanks Paul I'll try that!!

Regards,

Marty
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 07:48
Joined
Aug 30, 2003
Messages
36,127
Happy to help Marty!
 

Brianwarnock

Retired
Local time
Today, 15:48
Joined
Jun 2, 2003
Messages
12,701
There is an auto fit command so
Activesheet.Columns.Autofit

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

Brian
 

Brianwarnock

Retired
Local time
Today, 15:48
Joined
Jun 2, 2003
Messages
12,701
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

Top Bottom