Macro for Hide/Unhide columns with the same button

diazmlogistics

Board Regular
Joined
Nov 23, 2012
Messages
56
Hi everyone, I work mostly with formulas but am now trying out macros. I've seen many similar questions, but since I'm not familiar with macro's i'm having difficulty applying the concept. I figure this is a good starting point....

Need a macro for each button.
The sheet will be protected with a password (in the future, users will have varied access privileges).-No help on this.
Column A is designated as the "Button" Column.
There are 5 buttons here. Each representing the area on the sheet that needs to be viewed. Once the button is pressed, it takes you to that section of the sheet.
At this time, I have designated each column area as:
a-z
aa-az
ba-bz
ca-cz
da-dz
I have tried this formula with opening tabs, but this won't work.

Thanks!!!
 

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
Hi everyone, I work mostly with formulas but am now trying out macros. I've seen many similar questions, but since I'm not familiar with macro's i'm having difficulty applying the concept. I figure this is a good starting point....

Need a macro for each button.
The sheet will be protected with a password (in the future, users will have varied access privileges).-No help on this.
Column A is designated as the "Button" Column.
There are 5 buttons here. Each representing the area on the sheet that needs to be viewed. Once the button is pressed, it takes you to that section of the sheet.
At this time, I have designated each column area as:
a-z
aa-az
ba-bz
ca-cz
da-dz
I have tried this formula with opening tabs, but this won't work.

Thanks!!!
1. What kind of buttons are they... Form Controls or ActiveX?

2. What are the button names and which button (name) controls which set of columns?
 
Upvote 0
Hi, I haven't made them yet but they will be form controls. For now lets say:

DASH= b-z
WAVE= aa-az
PULL= ba-bz
HOLD= ca-cz
SUMMARY= da-dz

Thanks
 
Upvote 0
Is this kind of what you are looking for?

Columns("B:Z").Select
If Selection.EntireColumn.Hidden = True Then

Columns("A:AA").Select
Selection.EntireColumn.Hidden = False
Else
Columns("B:Z").Select
Selection.EntireColumn.Hidden = True
Range("A1").Select
End If
 
Upvote 0

Forum statistics

Threads
1,223,230
Messages
6,170,883
Members
452,364
Latest member
springate

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top