Re: Executing Macro Help
- From: Jan Karel Pieterse <jkpieterse@xxxxxxxxxxxx>
- Date: Tue, 01 May 2007 09:23:00 +0200
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
.
- References:
- Executing Macro Help
- From: alexdetrano
- Executing Macro Help
- Prev by Date: Re: requirement for creating a sub menu in c# excel addin
- Next by Date: Re: Substituting substrings
- Previous by thread: Re: Executing Macro Help
- Next by thread: Re: VBA Assistance needed to test for open file in a different dir
- Index(es):
Loading