C
Chirag
The following macro should help you get started:
Sub ClearCellsIfColorMatches(ByVal Sht As Worksheet, _
ByVal InteriorColor As Long)
Dim R As Long
Dim C As Long
With Sht.UsedRange
For R = .Row To .Row + .Rows.Count - 1
For C = .Column To .Column + .Columns.Count - 1
If Sht.Cells(R, C).Interior.Color = InteriorColor Then
Sht.Cells(R, C).Clear
End If
Next
Next
End With
End Sub
Pass it the worksheet that you want to process and the color value in RGB
format.
- Chirag
PowerShow - View multiple PowerPoint slide shows simultaneously
http://officeone.mvps.org/powershow/powershow.html
Sub ClearCellsIfColorMatches(ByVal Sht As Worksheet, _
ByVal InteriorColor As Long)
Dim R As Long
Dim C As Long
With Sht.UsedRange
For R = .Row To .Row + .Rows.Count - 1
For C = .Column To .Column + .Columns.Count - 1
If Sht.Cells(R, C).Interior.Color = InteriorColor Then
Sht.Cells(R, C).Clear
End If
Next
Next
End With
End Sub
Pass it the worksheet that you want to process and the color value in RGB
format.
- Chirag
PowerShow - View multiple PowerPoint slide shows simultaneously
http://officeone.mvps.org/powershow/powershow.html