Hello,
I have an excel with few hidden and unhidden tabs. I have written a VBA code for one of these tabs and then I hid the tab.
I will send this excel to someone else, and that someone will change the name of this tab.
How can I make the VBA code to get this variable name and run the code?
Sub Hide_Unhide()
Application.ScreenUpdating = False
Sheets("MyTab").Activate
If Range("E60").Value = 0 Then
'MsgBox "E60 is true"
Rows("26:26").EntireRow.Hidden = True
Else
Rows("26:26").EntireRow.Hidden = False
End If
If Range("E61").Value = 0 Then
'MsgBox "E61 is true - Nybyg, M1, >=5000"
Rows("28:29").EntireRow.Hidden = True
Else
Rows("28:29").EntireRow.Hidden = False
End If
Application.ScreenUpdating = True
End Sub
I have an excel with few hidden and unhidden tabs. I have written a VBA code for one of these tabs and then I hid the tab.
I will send this excel to someone else, and that someone will change the name of this tab.
How can I make the VBA code to get this variable name and run the code?
Sub Hide_Unhide()
Application.ScreenUpdating = False
Sheets("MyTab").Activate
If Range("E60").Value = 0 Then
'MsgBox "E60 is true"
Rows("26:26").EntireRow.Hidden = True
Else
Rows("26:26").EntireRow.Hidden = False
End If
If Range("E61").Value = 0 Then
'MsgBox "E61 is true - Nybyg, M1, >=5000"
Rows("28:29").EntireRow.Hidden = True
Else
Rows("28:29").EntireRow.Hidden = False
End If
Application.ScreenUpdating = True
End Sub