F
Fred
Can someone help me out here please. I can manually select columns H,
K, L, M, Q thru V, X and Y and excel neatly selects the individual
columns, I can then Format, Column, Autofit Selection and it ignores
the fact that there are merged cells spreading across the sheet.
However when I try the same in VB it selects across the whole sheet
because there are merged cells across various of the columns and
spreads out across and beyond the width of the screen.
I tried performing the task manually and recording my actions into a
macro, it generated the following code, but when I ran the code in my
overall macro it simply grabs columns B thru X because that is where
there is a set of merged cells, and expands the width "ignoring my
wishes".
Range("H:H,K:K,L:L,M:M,Q:V,X:Y").Select
Range("X29").Activate
Selection.Columns.AutoFit
Is there a way around this "feature"
Thanks in advance
Regards
Fred
K, L, M, Q thru V, X and Y and excel neatly selects the individual
columns, I can then Format, Column, Autofit Selection and it ignores
the fact that there are merged cells spreading across the sheet.
However when I try the same in VB it selects across the whole sheet
because there are merged cells across various of the columns and
spreads out across and beyond the width of the screen.
I tried performing the task manually and recording my actions into a
macro, it generated the following code, but when I ran the code in my
overall macro it simply grabs columns B thru X because that is where
there is a set of merged cells, and expands the width "ignoring my
wishes".
Range("H:H,K:K,L:L,M:M,Q:V,X:Y").Select
Range("X29").Activate
Selection.Columns.AutoFit
Is there a way around this "feature"
Thanks in advance
Regards
Fred