For Each Sheet in Worksheets

kylemck4

New Member
Joined
Jan 19, 2003
Messages
42
Can you "grab" the ActiveSheet name when using the "For Each Sheet in Worksheets"? ie.

For Each Sheet in Worksheets
Workbooks("Name").Worksheets.("ActiveSheet").Range....

If not, is there are a way of accomplishing this?
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
ws.Name

as ws varies each time you loop to the next sheet.

Always reply on your original thread else people have absolutely no idea what you're going on about...also when you reply on your original post, those others who have also posted on it will be notified.
 
Upvote 0
Since you are already looping, and you have a Sheet object in there, you can use it:

For each Sheet in Worksheets
Sheet.Range("...")
Next Sheet
 
Upvote 0

Forum statistics

Threads
1,215,377
Messages
6,124,598
Members
449,174
Latest member
chandan4057

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