E
ExcelMonkey
I am using this code to clear the interior colour of all
the worksheets in my workbook. When I run it, I get an
run time error 1004 "Unable to set Color Index Property of
Inerior Class. Why is this happening?
Answer = MsgBox(Prompt:="You have decided to print a
colour map. Accordingly, this routine will change all
your current formatting in the model to white in order to
colour it effectively. Please note that this will also
take out the existing conditionl formatting in the
spreadsheet.", Buttons:=vbYesNo + vbQuestion)
If Answer = vbYes Then
'Change colour index to white
'Also take out conditional formatting
For Each sh In ActiveWorkbook.Worksheets
sh.Cells.Interior.ColorIndex = xlNone
sh.Cells.FormatConditions.Delete
Next sh
End If
the worksheets in my workbook. When I run it, I get an
run time error 1004 "Unable to set Color Index Property of
Inerior Class. Why is this happening?
Answer = MsgBox(Prompt:="You have decided to print a
colour map. Accordingly, this routine will change all
your current formatting in the model to white in order to
colour it effectively. Please note that this will also
take out the existing conditionl formatting in the
spreadsheet.", Buttons:=vbYesNo + vbQuestion)
If Answer = vbYes Then
'Change colour index to white
'Also take out conditional formatting
For Each sh In ActiveWorkbook.Worksheets
sh.Cells.Interior.ColorIndex = xlNone
sh.Cells.FormatConditions.Delete
Next sh
End If