akinkaraman
Member
I have 2 macros. One of them searches a value and find the searched values in the sheet and shows them as in a different colored cell. The other man cleans the colored searched cells.
What I want is to combine these 2 macros into 1 macro which will ask if I want to search a value or clean the colored cells.
Could you please help me to combine these 2 macros?
Search-Find-Color Macro
Clean the color
Thanks in Advance..
What I want is to combine these 2 macros into 1 macro which will ask if I want to search a value or clean the colored cells.
Could you please help me to combine these 2 macros?
Search-Find-Color Macro
Code:
Sub Find_Color()
Dim sor As String, c As Range, Adr As String
sor = Application.InputBox("What are you looking for?", "Search")
If sor = "" Then Exit Sub
Cells.Interior.ColorIndex = 0
With Cells
Set c = .Find(sor, , xlValues, xlWhole)
If Not c Is Nothing Then
Adr = c.Address
Do
c.Interior.Color = 49407
Set c = .FindNext(c)
Loop While Not c Is Nothing And c.Address <> Adr
End If
End With
End Sub
Clean the color
Code:
Sub Clean_Color()
Cells.Interior.ColorIndex = 0
End Sub
Thanks in Advance..