Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem with removing color from cell

Status
Not open for further replies.

UnsolvedCoding

Technical User
Jul 20, 2011
424
US
I can't figure out why the color won't get removed from a cell. I have tried many variations of what is below both with color and color index.

Sheets("Info").Range("AL" & B - 9 & ":AP" & B - 9).Interior.ColorIndex = -4142

Sheets("Info").Range("AL" & B - 9 & ":AP" & B - 9).Interior.ColorIndex = 0

Sheets("Info").Range("AL" & B - 9 & ":AP" & B - 9).Interior.ColorIndex = xlnone

Sheets("Info").Range("AL" & B - 9 & ":AP" & B - 9).Interior.ColorIndex = xlcolorindexnone

Coloring the cells hasn't been a problem. Both of these are accepted without question.
Sheets("Info").Range("AG" & C + 1 & ":AI" & C + 1).Interior.ColorIndex = 36
Sheets("Info").Range("AG" & C + 1 & ":AI" & C + 1).Interior.Color = 10092543
 
Hi,

Personally, I'd be trying to solve this problem on the sheet. THEN, having found a solution, apply the code if this problem tends to be recurring.

Do you have any Conditional Formatting in this range?

Skip,

[glasses]Just traded in my OLD subtlety...
for a NUance![tongue]
 
No conditional formatting.

I have tried the macro recorder but get the same problem.

One thing I just realized I haven't done is use a with statement. I will give that a shot.

 
Can you upload your workbook?

Skip,

[glasses]Just traded in my OLD subtlety...
for a NUance![tongue]
 
I can tell you that the excel sheet is used to make panel layouts for communication and power distribution.
 
Can't you MANUALLY Select ALL cells and change the Interior to No Fill?

Skip,

[glasses]Just traded in my OLD subtlety...
for a NUance![tongue]
 
Got it. Instead of subtracting from the value of B I changed the value of B to compensate and it runs.

Thanks Skip.
 
Are you running a loop?

Just reference the entire range: ONE STATEMENT.

Skip,

[glasses]Just traded in my OLD subtlety...
for a NUance![tongue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top