Analyst232
New Member
- Joined
- Mar 22, 2021
- Messages
- 6
Hi Everyone,
I am brand new to VBA/Macro. I am trying to develop a DIY forecasting template and need some help creating four buttons.
Request
I would like to create buttons to consecutively unhide a column/row (preferably within a defined range) and have this button (macro) linked to another sheet within this workbook.
Progress?
I developed Macros for each of the buttons, but it is pretty much the same Macro that works okay, but references the next active cell, does not have a defined range, and is not linked to the other worksheet.
Please see my descriptions/screenshot below and I would really appreciate any help . Thank you!
Sub UnhideColumn()
Sheet1.Protect Password:="pass123", UserInterfaceOnly:=True
ActiveCell.Offset(0, 1).Range("A1:A1").Columns("A:A").EntireColumn.Select
Selection.EntireColumn.Hidden = False
End Sub
Green/Blue/Gray Button:
Sub UnhideRow()
Sheet1.Protect Password:="pass123", UserInterfaceOnly:=True
ActiveCell.Offset(1, 0).Rows("1:1").EntireRow.Select
Selection.EntireRow.Hidden = False
End Sub
I am brand new to VBA/Macro. I am trying to develop a DIY forecasting template and need some help creating four buttons.
Request
I would like to create buttons to consecutively unhide a column/row (preferably within a defined range) and have this button (macro) linked to another sheet within this workbook.
Progress?
I developed Macros for each of the buttons, but it is pretty much the same Macro that works okay, but references the next active cell, does not have a defined range, and is not linked to the other worksheet.
Please see my descriptions/screenshot below and I would really appreciate any help . Thank you!
- Red Button: Unhides the next single column from: Column H - AH
- Green Button: Unhide the next single row from: Row 8 - 16
- Blue Button: Unhide the next single row from: Row 18 - 32
- Gray Button: Unhide the single row from: Row 34 - 37
Sub UnhideColumn()
Sheet1.Protect Password:="pass123", UserInterfaceOnly:=True
ActiveCell.Offset(0, 1).Range("A1:A1").Columns("A:A").EntireColumn.Select
Selection.EntireColumn.Hidden = False
End Sub
Green/Blue/Gray Button:
Sub UnhideRow()
Sheet1.Protect Password:="pass123", UserInterfaceOnly:=True
ActiveCell.Offset(1, 0).Rows("1:1").EntireRow.Select
Selection.EntireRow.Hidden = False
End Sub