ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   vb code to hide columns (https://www.excelbanter.com/excel-discussion-misc-queries/232100-vbulletin-code-hide-columns.html)

pm tlb

vb code to hide columns
 
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


Jacob Skaria

vb code to hide columns
 
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
---------------
Jacob Skaria


"pm tlb" wrote:

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


Don Guillett

vb code to hide columns
 
Surely, you can figure out how to make the change. Or, is there more to your
question?

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"pm tlb" <pm
wrote in message
...
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



pm tlb[_2_]

vb code to hide columns
 
Got it, worked like a charm,Thank you!

"Don Guillett" wrote:

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

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"pm tlb" <pm
wrote in message
...
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




Jacob Skaria

vb code to hide columns
 
Cheers..

If this post helps click Yes
---------------
Jacob Skaria


"pm tlb" wrote:

Got it, worked like a charm,Thank you!

"Don Guillett" wrote:

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

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"pm tlb" <pm
wrote in message
...
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





All times are GMT +1. The time now is 07:14 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com