PC Review


Reply
Thread Tools Rate Thread

Activate Range for Workbooks Already Open

 
 
shorticake
Guest
Posts: n/a
 
      13th Dec 2007
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 With Quote
 
 
 
 
Bob Phillips
Guest
Posts: n/a
 
      13th Dec 2007

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" <(E-Mail Removed)> wrote in message
news:1A77D749-BAEF-4440-BBCE-(E-Mail Removed)...
> 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 With Quote
 
JLGWhiz
Guest
Posts: n/a
 
      13th Dec 2007
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 With Quote
 
shorticake
Guest
Posts: n/a
 
      14th Dec 2007
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" <(E-Mail Removed)> wrote in message
> news:1A77D749-BAEF-4440-BBCE-(E-Mail Removed)...
> > 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 With Quote
 
Bob Phillips
Guest
Posts: n/a
 
      14th Dec 2007
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" <(E-Mail Removed)> wrote in message
news:7A3ED077-F58D-43A4-AAFB-(E-Mail Removed)...
> 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" <(E-Mail Removed)> wrote in message
>> news:1A77D749-BAEF-4440-BBCE-(E-Mail Removed)...
>> > 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 With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Copy user selected range from all open workbooks rsphorler Microsoft Excel Programming 2 5th Jan 2010 03:57 PM
Access Named range value with multiple workbooks open ksgoodwin@gmail.com Microsoft Excel Programming 3 15th Dec 2006 01:25 AM
Windows().Activate vs Workbooks().Activate =?Utf-8?B?R2FyeScncyBTdHVkZW50?= Microsoft Excel Programming 4 6th Nov 2006 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 Microsoft Excel Programming 2 15th Jun 2004 03:21 AM
Excel VBA - Activate Open Workbooks to format exceller Microsoft Excel Programming 2 10th Jun 2004 12:14 PM


Features
 

Advertising
 

Newsgroups
 


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