Change worksheet tab colors failing

J

John

I'm using the following code to clear the colors from a worksheet tab and am
getting a "Subscript out of range" error:
Sheets("aaaDetail").Range("$A$1").Select
Sheets("aaaDetail").Tab.ColorIndex = xlAutomatic

The first statement selects cell A1 fine, but the second errors.

I appreciate your help, -John
 
J

Joel

from
Sheets("aaaDetail").Tab.ColorIndex = xlAutomatic
to
Sheets("aaaDetail").Tab.ColorIndex = -4142
 
Top