Select All Sheets and clear Interior Cell colours

E

ExcelMonkey

How do you select all sheets in VBA to clear interior
colours. When I record it looks like this. However I
want to avoid using sheet names like this.


Sheets(Array
("Sheet1", "Sheet2", "Sheet3", "Sheet4", "Sheet5","Sheet6"
, "Sheet7", "Sheet8", "Sheet9")). Select
Sheets("Audit Results").Activate
Cells.Select
Selection.Interior.ColorIndex = xlNone
 
B

Bob Phillips

For Each sh In ACtiveworkbook.Worksheets
sh.Cells.Interior.ColorIndex = xlNone
Next sh

--

HTH

RP
(remove nothere from the email address if mailing direct)
 
J

Jim Thomlinson

You can not just select all of the worksheets, but you can traverse through
the collection of worksheets...

dim wks as worksheet

for each wks in worksheets
wks.cells.Interior.ColorIndex = xlNone
next wks

HTH
 
G

Gord Dibben

Sub clear_color()
Application.ScreenUpdating = False
Dim n As Single
For n = 1 To Sheets.Count
Sheets(n).Cells.Interior.ColorIndex = xlNone
Next n
Application.ScreenUpdating = True
End Sub


Gord Dibben Excel MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top