Have a go with this (note it also clears the yellow in cells)
Sub DelYellows()
Dim lClr As Long
Dim rng As Range, c As Range
If TypeName(Selection) <> "Range" Then
MsgBox "Select cells"
Exit Sub
End If
Set rng = Intersect(ActiveSheet.UsedRange, Selection)
If rng Is Nothing Then
' selection outside the usedrange
Exit Sub
End If
If rng.Count > 100000 Then
If MsgBox(rng.Count & " cells to process, might take a while", _
vbOKCancel) <> vbOK Then
Exit Sub
End If
End If
For Each c In rng
If c.Interior.Color = vbYellow Then
c.Interior.ColorIndex = xlNone
c.ClearContents
End If
Next
End Sub
Regards,
Peter T
<(E-Mail Removed)> wrote in message
news:349fa44c-399f-4fbb-9e94-(E-Mail Removed)...
> Hi,
> I am trying to make a macro that when I run it, it Deletes the values
> of the cells that are yellow in interior color,
> I appreciate for any help! Thanks!
|