hide coloumn

K

kalpesh

Hello
i like to hide all column except column "A,B,C,D" with worksheet 1 i
active only for macro
 
D

Don Guillett

Hello,
i like to hide all column except column "A,B,C,D" with worksheet 1 is
active only for macro

You didn't mention excel version so this should work with all

Sub hidecolumns()
Dim lc As Long
With ActiveSheet
lc = Cells(1, "d").End(xlToRight).Column
.Columns.Hidden = False
.Columns(5).Resize(, lc - 4).Hidden = True
End With
End Sub
 
Top