Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default Search for worksheet name in Excel spreadsheet

I am trying to find the best way to search for a particular worksheet name
in the spreadsheet that has many worksheets in the file (search in opened
spreadsheet). Search result need move me in to appropriate worksheet. Some
worksheet in that workbook may have the same name, marked with 1, 2, 3..
like Name-1, Name-2, Name-3.. or Name1, Name2, etc
I appreciate any help and code samples.

Regards,
S.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,355
Default Search for worksheet name in Excel spreadsheet

Try something like this:

Dim myWB As Workbook
Dim myWS As Worksheet

Set myWS = Nothing
On Error Resume Next
Set myWS = Worksheets("Name-1")
On Error GoTo 0
If Not myWS Is Nothing Then
MsgBox ("You've found your worksheet.")
Else
MsgBox ("You haven't found your worksheet")
End If

--
HTH,
Barb Reinhardt



"SANTANDER" wrote:

I am trying to find the best way to search for a particular worksheet name
in the spreadsheet that has many worksheets in the file (search in opened
spreadsheet). Search result need move me in to appropriate worksheet. Some
worksheet in that workbook may have the same name, marked with 1, 2, 3..
like Name-1, Name-2, Name-3.. or Name1, Name2, etc
I appreciate any help and code samples.

Regards,
S.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 789
Default Search for worksheet name in Excel spreadsheet

On Oct 25, 3:11 pm, "SANTANDER" wrote:
I am trying to find the best way to search for a particular worksheet name
in the spreadsheet that has many worksheets in the file (search in opened
spreadsheet). Search result need move me in to appropriate worksheet. Some
worksheet in that workbook may have the same name, marked with 1, 2, 3..
like Name-1, Name-2, Name-3.. or Name1, Name2, etc
I appreciate any help and code samples.

Regards,
S.


Hi
Activeworkbook.Worksheets("Name1").Activate

will activate the sheet called "Name1"

If the workbook is open but not necessarily active then
Workbooks("Myworkbook).Worksheets("Name1").Activat e

will do it.

It would be easy to populate a drop down menu with worksheet names for
users to pick from, if that is what you want?
regards
Paul

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default Search for worksheet name in Excel spreadsheet


wrote in message
ups.com...
On Oct 25, 3:11 pm, "SANTANDER" wrote:
I am trying to find the best way to search for a particular worksheet
name
in the spreadsheet that has many worksheets in the file (search in opened
spreadsheet). Search result need move me in to appropriate worksheet.
Some
worksheet in that workbook may have the same name, marked with 1, 2, 3..
like Name-1, Name-2, Name-3.. or Name1, Name2, etc
I appreciate any help and code samples.

Regards,
S.

------------
Hi
Activeworkbook.Worksheets("Name1").Activate


will activate the sheet called "Name1"


If the workbook is open but not necessarily active then
Workbooks("Myworkbook).Worksheets("Name1").Activat e


will do it.


It would be easy to populate a drop down menu with worksheet names for
users to pick from, if that is what you want?
regards
Paul

-------------

Yes, populating a drop down menu with worksheet names for users to pick
from(when this required only, not constantly) may be an option.
How should look this code and where it goes - inside Module1? Does this code
will count newly added worksheet also?

Regards,
Santander

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Search for worksheet name in Excel spreadsheet

Sub FindSheet()
Dim i As Integer
Name = InputBox("Please Enter the Name of the Worksheet to Find",
"SheetSearch", vbOKOnly)
For i = 1 To Worksheets.Count
If Application.ActiveWorkbook.Sheets(i).Name = Name Then
Application.ActiveWorkbook.Sheets(i).Select
End If
Next
End Sub

Try this one



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default Search for worksheet name in Excel spreadsheet


"Valli" wrote in message
oups.com...
Sub FindSheet()
Dim i As Integer
Name = InputBox("Please Enter the Name of the Worksheet to Find",
"SheetSearch", vbOKOnly)
For i = 1 To Worksheets.Count
If Application.ActiveWorkbook.Sheets(i).Name = Name Then
Application.ActiveWorkbook.Sheets(i).Select
End If
Next
End Sub

Try this one

-------

Tried, not work. when type name in input box and run, stay with no changes.
The main idea is make searching for worksheet name in spreadsheet much more
handy than gives us built-in Excel tool 'Find and Replace' that can easily
search within Sheet and Workbook, by Rows or by Column. As i understand,
custom search need be more handy and more simple compare with built-in one.

Regards,
S.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
search word or text in excel spreadsheet Louis Excel Discussion (Misc queries) 1 January 18th 08 03:30 PM
Search Spreadsheet - Results in either listbox or new spreadsheet Brandon Johnson Excel Programming 1 June 7th 06 03:19 PM
A Search Engine inside Excel Spreadsheet Edgar Excel Discussion (Misc queries) 2 March 29th 06 04:51 PM
how do i do a search in a spreadsheet thas has multiple worksheet Phil Excel Discussion (Misc queries) 2 March 23rd 06 12:21 PM
Create a search Field within a worksheet to search command buttons Ed P[_2_] Excel Programming 1 December 14th 04 08:04 PM


All times are GMT +1. The time now is 09:39 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"