Hi Excel VBA Experts,
I have created a VBA to jump the Sheet on base of cell value.
But it does not work, can someone help me?
I have a Menu Sheet where a value has stores in B1 cell (Between 1 and 8)
If I click a Text Box link to this Macro, on the base of this value, need to go that Sheet.
Sub Menu_Sheet()
ThisWorkbook.Sheets("MENU").Select
Dim myOp As Integer
myOp = Range("B1").Value
If myOp = 1 Then ThisWorkbook.Sheets("Daily Data").Select
If myOp = 2 Then ThisWorkbook.Sheets("QNB Nexus").Select
If myOp = 3 Then ThisWorkbook.Sheets("Salary").Select
If myOp = 4 Then ThisWorkbook.Sheets("T Summary").Select
If myOp = 5 Then ThisWorkbook.Sheets("Muhsin").Select
If myOp = 6 Then ThisWorkbook.Sheets("Sponsor Fees").Select
If myOp = 7 Then ThisWorkbook.Sheets("S Summary").Select
If myOp = 8 Then ThisWorkbook.Sheets("Hassan Al Hilal").Select
End Sub
Thanks and Regards
I have created a VBA to jump the Sheet on base of cell value.
But it does not work, can someone help me?
I have a Menu Sheet where a value has stores in B1 cell (Between 1 and 8)
If I click a Text Box link to this Macro, on the base of this value, need to go that Sheet.
Sub Menu_Sheet()
ThisWorkbook.Sheets("MENU").Select
Dim myOp As Integer
myOp = Range("B1").Value
If myOp = 1 Then ThisWorkbook.Sheets("Daily Data").Select
If myOp = 2 Then ThisWorkbook.Sheets("QNB Nexus").Select
If myOp = 3 Then ThisWorkbook.Sheets("Salary").Select
If myOp = 4 Then ThisWorkbook.Sheets("T Summary").Select
If myOp = 5 Then ThisWorkbook.Sheets("Muhsin").Select
If myOp = 6 Then ThisWorkbook.Sheets("Sponsor Fees").Select
If myOp = 7 Then ThisWorkbook.Sheets("S Summary").Select
If myOp = 8 Then ThisWorkbook.Sheets("Hassan Al Hilal").Select
End Sub
Thanks and Regards
Last edited: