![]() |
|
#2
|
|||
|
|||
|
I have never had much luck with the find all since usually I am looking in thousands of cells of data. However the code below will highlight any cells on the worksheet orange if there is an exact match and the yellow if there is a partial match. Be sure to save and backup your workbook before running.
Code:
Sub HighlightSearch()
Dim rng As Range, c As Variant, SearchString As String
SearchString = InputBox("Search the used range for?")
If SearchString = "" Then End
Set rng = ActiveSheet.UsedRange
For Each c In rng
If InStr(1, UCase(c.Value), UCase(SearchString)) Then
c.Interior.ColorIndex = 6 'highlights yellow
End If
If UCase(c.Value) = UCase(SearchString) Then
c.Interior.ColorIndex = 45 'highlights orange
End If
Next c
End Sub
|
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Find/Replace is not working - Excel 2010 | fieldhaven | Excel | 2 | 02-19-2014 08:30 AM |
| 2013 search results take a long time - they fill in as results in reverse date order | themookman | Outlook | 0 | 10-11-2013 12:01 PM |
Find and Replace using Excel range
|
dmarie123 | Word VBA | 15 | 04-02-2013 07:54 AM |
Find Results in excel copy the rows to another sheet
|
khalidfazeli | Excel | 2 | 02-06-2013 09:38 AM |
| Needs help to find excel formula- Please | aamer_1983 | Excel | 2 | 07-13-2009 01:46 AM |