Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default Activate Range for Workbooks Already Open

Could anyone help me with code to search through the file names of workbooks
I already have open, and for each file that meets my search criteria make a
specific worksheet and range active?

Thanks
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Activate Range for Workbooks Already Open


For Each wb In Application.Workbooks

If wb.name Like "*This*" then

wb.Activate
Worksheets(3).Activate
range("A3").Select
End If
Next wb

--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my addy)



"shorticake" wrote in message
...
Could anyone help me with code to search through the file names of
workbooks
I already have open, and for each file that meets my search criteria make
a
specific worksheet and range active?

Thanks



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default Activate Range for Workbooks Already Open

Thanks so much Bob!

One last question, is there a way to say not like "*This*" ?


"Bob Phillips" wrote:


For Each wb In Application.Workbooks

If wb.name Like "*This*" then

wb.Activate
Worksheets(3).Activate
range("A3").Select
End If
Next wb

--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my addy)



"shorticake" wrote in message
...
Could anyone help me with code to search through the file names of
workbooks
I already have open, and for each file that meets my search criteria make
a
specific worksheet and range active?

Thanks




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Activate Range for Workbooks Already Open

Yeah, but it's tricky

If Not wb.name Like "*This*" then

<VBG

--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my addy)



"shorticake" wrote in message
...
Thanks so much Bob!

One last question, is there a way to say not like "*This*" ?


"Bob Phillips" wrote:


For Each wb In Application.Workbooks

If wb.name Like "*This*" then

wb.Activate
Worksheets(3).Activate
range("A3").Select
End If
Next wb

--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my
addy)



"shorticake" wrote in message
...
Could anyone help me with code to search through the file names of
workbooks
I already have open, and for each file that meets my search criteria
make
a
specific worksheet and range active?

Thanks






  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default Activate Range for Workbooks Already Open

Dim sh As Worksheet
Dim wb As Workbook
For Each wb In Workbooks
If wb.Name < ThisWorkbook.Name Then
wb.Activate
For Each sh In Active.Workbook.Sheets
If sh ('meets criteria) Then
'Do Something
End If
Next
End If
Next

"shorticake" wrote:

Could anyone help me with code to search through the file names of workbooks
I already have open, and for each file that meets my search criteria make a
specific worksheet and range active?

Thanks



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
Access Named range value with multiple workbooks open [email protected][_2_] Excel Programming 3 December 15th 06 01:25 AM
Windows().Activate vs Workbooks().Activate Gary''s Student Excel Programming 4 November 6th 06 02:01 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
Excel VBA - Activate Open Workbooks to format exceller Excel Programming 2 June 10th 04 12:14 PM
Use Array to activate workbooks Stuart[_5_] Excel Programming 3 December 2nd 03 08:17 PM


All times are GMT +1. The time now is 02:31 PM.

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

About Us

"It's about Microsoft Excel"