How to Run Macro on specific sheet?

Rookie79

New Member
Joined
Sep 15, 2011
Messages
6
1st off, this is my first attempt at a macro. I copied someone posted here and tweaked it for hours till it did what I wanted it to do. I was so happy! Now, I am wanting to use the macro on one sheet and another macro in the 2nd sheet. Sheet one is named WTD, sheet 2 is named YTD. My code is rather long but I can post it if needed. I am sure I am overlooking something simple but each time I run the macros, they both run on WTD tab.

What I am doing is taking the info in 3 columns on each of my tabs and compiling it into one sheet. For WTD it is going to be coulmns G, H, I and for YTD it is going to be coulmns P, Q, R. I have one macro that pulls the WTD coulmns and one to pull the YTD columns. No matter what I try, both marcos will only run on the first tab, "WTD"

Any help would be greatly appreciated!
:)
 
Thats not working. I guess the problem is that I am trying to run 2 seperate macros. One on the WTD tab that pulls from certain columns in the rest of the sheets, and another on the YTD tab that pulls numbers from different columns on the sheets. When I run the WTD macro, it goes perfect, when I run the seperate macro on the YTD tab, it pulsl the correct numbers, but puts it onthe WTD tab.
 
Upvote 0

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest
If I could see your code it would help.

Remember to use the # symbol on the tool bar to create a window to put your code into. Put your code after the 1st word "
Code:
".  Also it help sometimes to Preview your post before Submitting it.
 
Upvote 0
Rookie79,

Can we see all of your code?

At the beginning of your posted code, enter the following without the * character:
[*code]

Your code goes here.

At the end of your posted code, enter the following without the * character:
[*/code]
 
Upvote 0

Forum statistics

Threads
1,224,613
Messages
6,179,903
Members
452,948
Latest member
Dupuhini

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top