Re: Executing Macro Help



Hi,

For example, I'm in Profits work*** and choose best scenario from
the combo box, and it changes B92 in Rev tab. Also, is there a way to
keep focus on the work*** and have it still execute the macro?

I assume your macro was recorded and uses things like :

Range("A1").DoSomething

If you want to do this on just one work***, surround your entire code
(inside a sub) with:

With Worksheets("YourSheet")
'Your code
End With

Now for each "Range" make sure you prepend it with a dot:

Range(.......

This way your code now talks to ranges on "Your***".

To make sure that work*** is visible, add:

Activate

anywhere within the with...end with construction.

Regards,

Jan Karel Pieterse
Excel MVP
http://www.jkp-ads.com
Member of:
Professional Office Developer Association
www.proofficedev.com

.


Loading