Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 425
Default search all open workbooks for sheet name

find sheet name "x" in all open workbooks.
go to sheet, cell a1.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default search all open workbooks for sheet name

Give this code a try...

Sub GotoSheetA1onSheetNamedX()
Dim WB As Workbook
On Error Resume Next
For Each WB In Application.Workbooks
WB.Worksheets("X").Activate
WB.Worksheets("X").Range("A1").Select
Next
End Sub

Change all the X's to the actual name of the sheet you want to go to.

--
Rick (MVP - Excel)


"J.W. Aldridge" wrote in message
...
find sheet name "x" in all open workbooks.
go to sheet, cell a1.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 425
Default search all open workbooks for sheet name

trying to find workbook with worksheet that has same name. Ending of
name may vary, but starts off as code indicates.
Code doesn't work... any clues?

Sub GotoSheetA1onSheetNamedX()
Dim wb As Workbook
On Error Resume Next
For Each wb In Application.Workbooks
wb.Worksheets("2ndex_to*").Activate
wb.Worksheets("2ndex_to*").Range("A1").Select
Next
End Sub
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default search all open workbooks for sheet name

You have to give us *all* the information regarding your problem in order
for us to give you code that you can use. It is almost always a bad idea to
simplify your examples or needs when you ask questions on newsgroups.

Give this code a try...

Sub GotoSheet()
Dim WB As Workbook
Dim WS As Worksheet
On Error Resume Next
For Each WB In Application.Workbooks
For Each WS In WB.Worksheets
If WS.Name Like "2ndex_to*" Then
WS.Activate
WS.Range("A1").Select
End If
Next
Next
End Sub

--
Rick (MVP - Excel)


"J.W. Aldridge" wrote in message
...
trying to find workbook with worksheet that has same name. Ending of
name may vary, but starts off as code indicates.
Code doesn't work... any clues?

Sub GotoSheetA1onSheetNamedX()
Dim wb As Workbook
On Error Resume Next
For Each wb In Application.Workbooks
wb.Worksheets("2ndex_to*").Activate
wb.Worksheets("2ndex_to*").Range("A1").Select
Next
End Sub


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 425
Default search all open workbooks for sheet name

thanx.
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 and open excel workbooks from a master workbook ECM Excel Discussion (Misc queries) 1 April 25th 08 04:58 PM
Open Workbooks, Used Area on Sheet Hal Excel Programming 3 August 27th 07 05:14 PM
Search open sheets in workbook and insert into open sheet punx77 Excel Discussion (Misc queries) 0 March 6th 06 05:07 PM
Excel 2003 Workbooks.Open with CorruptLoad=xlRepairFile fails on Excel 5.0/95 file due to Chart, with Error 1004 Method 'Open' of object 'Workbooks' failed Frank Jones Excel Programming 2 June 15th 04 03:21 AM
comparing cells in different workbooks - open a certain sheet Walt[_2_] Excel Programming 0 July 28th 03 06:46 PM


All times are GMT +1. The time now is 02:57 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"