andrewlau2881
New Member
- Joined
- Oct 20, 2023
- Messages
- 15
- Office Version
- 365
- Platform
- Windows
Hi all,
I have sheets which are updated from a master for hundreds of people in my organisation. When I update the master I would like all the other sheets to recognise this and unhide columns which have now been populated from the master. The VBA code I have works on the sheet that is open. However, I would like it to then run on sheet 5-100 of that same workbook. I have tried piecing together something from various sources but can't get anything to work fully.
I have sheets which are updated from a master for hundreds of people in my organisation. When I update the master I would like all the other sheets to recognise this and unhide columns which have now been populated from the master. The VBA code I have works on the sheet that is open. However, I would like it to then run on sheet 5-100 of that same workbook. I have tried piecing together something from various sources but can't get anything to work fully.
VBA Code:
Sub Workbook_Open()
Dim p As Integer
For p = 2 To 31
If Cells(1, p).Value = "" Then
Columns(p).Hidden = True
Else: Columns(p).Hidden = False
End If
Next p
End Sub