hi, i'm trying to find a way to prefix a macro i have so that when it is run it will only apply to a certain tab within a worksheet. currently, when run it will apply to the current tab i am in when i run it..
hi, i'm trying to find a way to prefix a macro i have so that when it is run it will only apply to a certain tab within a worksheet. currently, when run it will apply to the current tab i am in when i run it..
Something like:
Please Login or Register to view this content.
Regards, TMS
Trevor Shuttleworth - Retired Excel/VBA Consultant
I dream of a better world where chickens can cross the road without having their motives questioned
'Being unapologetic means never having to say you're sorry' John Cooper Clarke
You need to specify the tab name....for e.g.
considering that File is the workbook and Test is the sheet.Please Login or Register to view this content.
If I have helped, Don't forget to add to my reputation (click on the star below the post)
Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
Use code tags when posting your VBA code: [code] Your code here [/code]
Thanks for the response. The answer is not quite what I was after though. The code you've provided means the macro will only run if i'm in a specific tab - which you have called "test sheet". I want the macro to run from any tab - but for the code to only apply to a specific tab. So I could be in Tab A or B but when I run the macro it ignores where I am and applies the code only to Tab C.
In that case, you probably need a With ... End With construct.
Something like:
Please Login or Register to view this content.
Be useful to see your code.
Regards, TMS
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks