vb code to hide columns

P

pm tlb

I have a spreadsheet that multiple people view. I need a macro to hide the
columns that some don't need to see and another macro to unhide the columns.
the macro I created hides columns B-M and I need it to hide F-K. The VB code
currently is

Columns("F:K").Select
Selection.EntireColumn.Hidden = True
End Sub
 
J

Jacob Skaria

Columns("F:K").Hidden = false
and
Columns("F:K").Hidden = True

and try this which will hide if visible and unhide if hidden
Columns("F:K").Hidden = not Columns("F:K").Hidden


If this post helps click Yes
 
D

Don Guillett

Surely, you can figure out how to make the change. Or, is there more to your
question?
 
P

pm tlb

Got it, worked like a charm,Thank you!

Don Guillett said:
Surely, you can figure out how to make the change. Or, is there more to your
question?

--
Don Guillett
Microsoft MVP Excel
SalesAid Software
(e-mail address removed)
 

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