OilEconomist
Active Member
- Joined
- Dec 26, 2016
- Messages
- 439
- Office Version
- 2019
- Platform
- Windows
Thanks in advance for your help and I will let you know what it took to make it work.
I would like to activate a sheet based on the contents of a cell.
For example within Sheet "Simulation". Cell C3 contains "Evaluate1", I would like to activate that sheet. I tried the following, but I get a "Run-time error '9', Subscript out of range"
What's wrong with my code?
Cell
I would like to activate a sheet based on the contents of a cell.
For example within Sheet "Simulation". Cell C3 contains "Evaluate1", I would like to activate that sheet. I tried the following, but I get a "Run-time error '9', Subscript out of range"
What's wrong with my code?
Cell
Code:
Sub Simulate ()[INDENT]
Dim SheetName As String
SheetName = Cells(3, 3).Value
Worksheet("SheetName").Activate[/INDENT]
End Sub