Apply VBA Code to multiple specific sheets

LNG2013

Active Member
Joined
May 23, 2011
Messages
466
I need to apply my code to 8 different sheets. Not all 8 sheets may be present. I need help with code that will look for each sheet eg. DataA, and if present will run the code on it. When the code is finished it will then check for the next sheet.

Possible Sheets:
DataA
DataB
DataC
DataD
DataE
DataF
DataG
DataH
 
Hard to tell without all the previous code and the With Structures...

Best bet is to use the macro recorder to do the task. It is our friend.
It will at least give the correct syntax.
Yes, it produces alot of the Selecting type of code.
But once you know how to clear that up, it's pretty easy.

If you can't get it that way, post the code produced by the macro recorder..
 
Upvote 0

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.

Forum statistics

Threads
1,224,811
Messages
6,181,081
Members
453,021
Latest member
Justyna P

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