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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top