doctorgresham
New Member
- Joined
- Aug 2, 2021
- Messages
- 6
- Office Version
- 365
- Platform
- MacOS
Hi,
I currently have the following macro on several sheets in a workbook that runs each time the sheets are activated. I'm looking to change it from being ran each time I click on the individual sheets to being ran only when a button is clicked on Sheet 1. So in other words, I want to make a button on sheet 1 that will run the following macro on sheets 2, 3, 4 etc. when i press it. I'm a novice when it comes to VB, so any help/ideas would be greatly appreciated!
Private Sub Worksheet_Activate()
Dim cell As Range
For Each cell In Range("A1:A424")
If cell.Value = "0" Then
cell.EntireRow.Hidden = True
ElseIf cell.Value = "1" Then
cell.EntireRow.Hidden = False
End If
Next
End Sub
I currently have the following macro on several sheets in a workbook that runs each time the sheets are activated. I'm looking to change it from being ran each time I click on the individual sheets to being ran only when a button is clicked on Sheet 1. So in other words, I want to make a button on sheet 1 that will run the following macro on sheets 2, 3, 4 etc. when i press it. I'm a novice when it comes to VB, so any help/ideas would be greatly appreciated!
Private Sub Worksheet_Activate()
Dim cell As Range
For Each cell In Range("A1:A424")
If cell.Value = "0" Then
cell.EntireRow.Hidden = True
ElseIf cell.Value = "1" Then
cell.EntireRow.Hidden = False
End If
Next
End Sub