PC Review


Reply
Thread Tools Rate Thread

active worksheet

 
 
Matthew Dyer
Guest
Posts: n/a
 
      16th Mar 2010
Set wb2 = Workbooks("LESTER, BRENDA.xls")


how do I replace the above code to set wb2 as the active sheet?
 
Reply With Quote
 
 
 
 
paul.bellrichard@gmail.com
Guest
Posts: n/a
 
      16th Mar 2010
Try...

Windows(wb2).Activate


On Mar 15, 10:00*pm, Matthew Dyer <matthew.e.d...@gmail.com> wrote:
> Set wb2 = Workbooks("LESTER, BRENDA.xls")
>
> how do I replace the above code to set wb2 as the active sheet?

 
Reply With Quote
 
Matthew Herbert
Guest
Posts: n/a
 
      16th Mar 2010
Matthew,

Try the following:

Dim Wks As Worksheet
Set Wks = ActiveSheet

(Note that if you don't specifically state the qualifing hierarchy, Excel
will build the hierarchy for you. For example, "Set Wks = ActiveSheet" will
be appended to be ActiveWorkbook.ActiveSheet, whereas something like "Set Wks
= Workbooks("test.xlsx").Worksheets(2)" will reference a specific worksheet
from a specific workbook, regardless of which workbook is currently active).

Best,

Matthew Herbert

"Matthew Dyer" wrote:

> Set wb2 = Workbooks("LESTER, BRENDA.xls")
>
>
> how do I replace the above code to set wb2 as the active sheet?
> .
>

 
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
Copying the active worksheet to another worksheet in the same work queenmaam Microsoft Excel Worksheet Functions 5 25th Mar 2008 06:56 PM
Deleting column in a worksheet that is not active worksheet kansaskannan@gmail.com Microsoft Excel Programming 3 7th Oct 2007 03:33 PM
Basic Question - How do I return the worksheet number of the active worksheet? Regnab Microsoft Excel Programming 2 17th May 2006 03:02 AM
Altering code to reference the worksheet before the active worksheet KimberlyC Microsoft Excel Programming 8 15th Mar 2005 10:26 PM
macro to apply worksheet event to active worksheet Paul Simon Microsoft Excel Programming 3 7th Aug 2003 02:50 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:51 PM.