I'm trying to write some code that links to certain sheets if certain cells are clicked. My sheets are named "01", "02", "03", ... , "20", ... "XX". I'm hoping I can use some loops to reference the names of the sheets since they are in a number format, but "j", which is how I tried to link cell rows with a corresponding sheet, in the code below doesn't cooperate. Can anyone help me fix this or can you simply not reference sheet names this way?
If ActiveCell.Column = 4 Or 5 Then
For i = 5 To 7
j = i - 4
If ActiveCell.Row = i Then
Sheets("0j").Activate
Exit Sub
Else
End If
Next
Else
End If
If ActiveCell.Column = 4 Or 5 Then
For i = 5 To 7
j = i - 4
If ActiveCell.Row = i Then
Sheets("0j").Activate
Exit Sub
Else
End If
Next
Else
End If