M
mholmes
I have the following sub which currently opens a Input Box that
displays the Sheet No. and the content of Cell A1 (for all sheets in
the Active workbook).
I want to adapt this sub, so that only visible sheets are shown in the
Input Box.
Can anybody please help?
I'm a newbie, and found extracts of the below sub by searching these
informative groups.
If you do have advice for me, it would be greatly appreciated if you
could spell out the code.
Thanks in advance.
************************************
Sub GotoSheet()
Dim mysht As Single
myshts = ActiveWorkbook.Sheets.count
For i = 1 To myshts
mylist = mylist & i & " .... " &
ActiveWorkbook.Sheets(i).Range("a1") & vbCr
Next i
On Error Resume Next
mysht = InputBox("To display the Calculation for a particular Tag
No," & _
vbCr & "Type the Number adjacent to the that Tag." & _
vbCr & vbCr & "(Example. Type 1, 2, or 3 etc...)" & vbCr & vbCr
& mylist)
If mysht = False Then Exit Sub
On Error GoTo Error
Sheets(mysht).Select
If mysht = mysht Then Exit Sub
Error:
MsgBox "Invalid Tag reference entered," & vbCr & "Please try again
....."
End Sub
displays the Sheet No. and the content of Cell A1 (for all sheets in
the Active workbook).
I want to adapt this sub, so that only visible sheets are shown in the
Input Box.
Can anybody please help?
I'm a newbie, and found extracts of the below sub by searching these
informative groups.
If you do have advice for me, it would be greatly appreciated if you
could spell out the code.
Thanks in advance.
************************************
Sub GotoSheet()
Dim mysht As Single
myshts = ActiveWorkbook.Sheets.count
For i = 1 To myshts
mylist = mylist & i & " .... " &
ActiveWorkbook.Sheets(i).Range("a1") & vbCr
Next i
On Error Resume Next
mysht = InputBox("To display the Calculation for a particular Tag
No," & _
vbCr & "Type the Number adjacent to the that Tag." & _
vbCr & vbCr & "(Example. Type 1, 2, or 3 etc...)" & vbCr & vbCr
& mylist)
If mysht = False Then Exit Sub
On Error GoTo Error
Sheets(mysht).Select
If mysht = mysht Then Exit Sub
Error:
MsgBox "Invalid Tag reference entered," & vbCr & "Please try again
....."
End Sub