View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_6_] Bob Phillips[_6_] is offline
external usenet poster
 
Posts: 11,272
Default Value to be given to all cells with black background color


Dim cell As Range
For Each cell In ActiveSheet.UsedRange
If cell.Interior.Color = 0 Then
cell.Value = 1
cell.Font.Color = RGB(&HFF, &HFF, &HFF)
End If
Next cell


--

HTH

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


"Norbert Jaeger" wrote in message
...
Hello,

I have a certain range of cells in which some of the cells are
formatted to have a black background color.
None of the cells contain any data.

I want to select the whole range of cells and then run a macro which
puts a "1" into each black cell. The white cells must stay empty.

How can I do this?

Regards,
Norbert