Hi.
I have a basic VBA script in a workbook of about 11 sheets. Right now the below script is running on the “financials” worksheet. I need these exact columns hidden in two other worksheets (“Total Financials” and “Current Deal”) but was hoping it could be run off of the exact same cell E9 value in “financials” tab. Essentially when the formula in E9 of the financials tab is calculated it hides the exact same columns in these three sheets. Is it easier to delete this and do one script in the ThisWorkbook? Any ideas on what I should do and the script I should use?
Private Sub Worksheet_Calculate()
With ActiveSheet
.Columns.Hidden = False
Select Case .Range(“E9”).Value
Case 36
.Range(“F:H”).EntireColumn.Hidden = True
Case 48
.Range(“G:H”).EntireColumn.Hidden = True
Case 60
.Columns(“H”).Hidden = True
Case 72
.Columns.Hidden = False
End Select
End With
End Sub
I have a basic VBA script in a workbook of about 11 sheets. Right now the below script is running on the “financials” worksheet. I need these exact columns hidden in two other worksheets (“Total Financials” and “Current Deal”) but was hoping it could be run off of the exact same cell E9 value in “financials” tab. Essentially when the formula in E9 of the financials tab is calculated it hides the exact same columns in these three sheets. Is it easier to delete this and do one script in the ThisWorkbook? Any ideas on what I should do and the script I should use?
Private Sub Worksheet_Calculate()
With ActiveSheet
.Columns.Hidden = False
Select Case .Range(“E9”).Value
Case 36
.Range(“F:H”).EntireColumn.Hidden = True
Case 48
.Range(“G:H”).EntireColumn.Hidden = True
Case 60
.Columns(“H”).Hidden = True
Case 72
.Columns.Hidden = False
End Select
End With
End Sub