View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Marcotte A Marcotte A is offline
external usenet poster
 
Posts: 66
Default Quick! Help With Code Formatting!

"alexm999 " wrote:

I have the following code:

Range("J9:O39").Select
Selection.Interior.ColorIndex = 35

When users say go to cell J9 and highlight the cell RED, then when I
run my macro, i'd like it to skip the formatting that the user inputted
and just change the color for the remaining cells in the range...

I'm assuming you want to change any cell that have not been changed already (rather than not changing only RED cells)

Sub test()
Dim Cell As Range
Range("J9:O39").Select
For Each Cell In Selection
If Cell.Interior.ColorIndex = xlNone Then Cell.Interior.ColorIndex = 35
Next Cell
End Sub