Hi,
Currently I have a workbook with about 60 sheets. Many sheets contain VB that will automatically hide or show various columns and rows when those sheets are clicked. I also have a workbook wide VB that checks each of those sheets to make sure they are formatted correctly on workbook close. (Just in case they haven't been clicked.)
My problem is that my workbook VB is only making sure that the rows are formatted correctly on close. i want it to also check the columns on the individual sheets. Below is the macro I am using. Any help on making this work to check columns in addition to rows would be great.
Thanks,
Ryan
Private Sub Workbook_Open()
Dim ShArray
Dim i
Dim MyRange, c As Range
Application.ScreenUpdating = False
Application.EnableEvents = False
ShArray = Array("Sheet Names Here")
For i = LBound(ShArray) To UBound(ShArray)
Set MyRange = Sheets(ShArray(i)).Range("A3:A68")
For Each c In MyRange
Sheets(ShArray(i)).Rows(c.Row).Hidden = c.Value = "H"
Next c
Next i
Application.EnableEvents = True
Application.ScreenUpdating = True
End Sub
Currently I have a workbook with about 60 sheets. Many sheets contain VB that will automatically hide or show various columns and rows when those sheets are clicked. I also have a workbook wide VB that checks each of those sheets to make sure they are formatted correctly on workbook close. (Just in case they haven't been clicked.)
My problem is that my workbook VB is only making sure that the rows are formatted correctly on close. i want it to also check the columns on the individual sheets. Below is the macro I am using. Any help on making this work to check columns in addition to rows would be great.
Thanks,
Ryan
Private Sub Workbook_Open()
Dim ShArray
Dim i
Dim MyRange, c As Range
Application.ScreenUpdating = False
Application.EnableEvents = False
ShArray = Array("Sheet Names Here")
For i = LBound(ShArray) To UBound(ShArray)
Set MyRange = Sheets(ShArray(i)).Range("A3:A68")
For Each c In MyRange
Sheets(ShArray(i)).Rows(c.Row).Hidden = c.Value = "H"
Next c
Next i
Application.EnableEvents = True
Application.ScreenUpdating = True
End Sub