For Each ws In ThisWorkbook.Worksheets question

thewaksta

New Member
Joined
Jan 9, 2008
Messages
23
Hi,

I'm very new to VBA and have a problem which I'm sure must be very simple to solve but I have no idea how to go about this.

I have a workbook with three permanent worksheets (Summary, Employees, Project Rules). I want to add new worksheets to this workbook and format them without touching the permanent sheets. I would like to tell VBA to format every worksheet that is not named Summary, Employees or Project Rules (or alternatively all worksheets except for Sheet1, Sheet2 or Sheet3). How can I do this?

Thanks
thewaksta
 
HI Neil,

I've added dots to qualify references, but then accually got a error message "Invalid or unquailified reference". Not sure if this is caused because of the fact that code isn't in active workbook.

Any suggestions.

Thanks
 
Upvote 0

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce

Forum statistics

Threads
1,215,757
Messages
6,126,693
Members
449,331
Latest member
smckenzie2016

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