Problem with Hiding Every Other Column
Hi
Comments and other objects on the screen can stop columns hiding. If
you have such, right click them, go to format and in properties choose
"move and size with cells".
regards
Paul
On Oct 14, 6:43*am, samdev wrote:
I have two workbooks/files - both workbooks have the macro below that
hides every column starting with Column B.
Sub hidecol()
Application.Calculation = xlCalculationManual
Application.ScreenUpdating = False
For i = 2 To 255 Step 2
If Columns(i).Hidden = False Then
Columns(i).Hidden = True
Else
Columns(i).Hidden = False
End If
Next i
Application.ScreenUpdating = True
Application.Calculation = xlCalculationAutomatic
End Sub
In workbook 1 it works just fine but in Workbook 2, it stops at the
following line: Columns(i).Hidden = True
The only difference (that I can detect) between the 2 workbooks is in
Workbook 2 there are more columns that contain data than in workbook
1.
Any ideas??
Thx!
|