Thread: Sort Worksheets
View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.misc
robert morris robert morris is offline
external usenet poster
 
Posts: 222
Default Sort Worksheets

Jacob,

Thanks for your reply. I am familar with VBA. I will try your code and let
you know the result. Today however is a really loaded work day.

Thanks,

Bob. M.

"Jacob Skaria" wrote:

Try one of these macros....

'Enter exact sheet name
Sub Macro1()
Dim strSheet As String, ws As Worksheet
strSheet = InputBox("Enter Sheet Name")

On Error Resume Next
Set ws = Sheets(strSheet)

If ws Is Nothing Then
MsgBox "Cannot find the sheet"
Else
Sheets(strSheet).Activate
End If

End Sub


'Enter a string..which match the sheetname
Sub Macro2()
Dim strSheet As String, ws As Worksheet
strSheet = InputBox("Enter Search String")
For Each ws In Sheets
If ws.Name Like "*" & strSheet & "*" Then ws.Activate: Exit Sub
Next
MsgBox "Cannot find a sheet with search string " & strSheet
End Sub

--
Jacob


"robert morris" wrote:

I have a WorkBook with 200+ Worksheets. I sort these A-Z with a VBA code.

Somewhere I read a tip on how to GoTo a Worksheet directly without scrolling
the Tabs. Am I dreaming?

Bob M.