Find and Mark

jackt05

Board Regular
Joined
Feb 1, 2009
Messages
194
Hi friends,

I have to manually enter the code nos. of the hard copy to find the code in the soft copy. After finding the number, I wish to mark it as so that double work should not be done or to find which code's hard copy is not with me.
I am using Find and Replace to find the number and after it is found I have to click the replace tab to enter colour in it.
Is there any auto function to mark as soon as I find the required number instead of clicking the replace tab to save my time.

Regards and thanks in advance
 

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result
Try this

Code:
Sub FindHighlight()
Dim tempCell As Range, Found As Range, FoundRange As Range, sTxt As String
sTxt = InputBox("Search string")
If sTxt = "False" Then Exit Sub
Set Found = Range("A1")
Set tempCell = Cells.Find(what:=sTxt, After:=Found, SearchDirection:=xlNext, MatchCase:=False)
If tempCell Is Nothing Then
    MsgBox prompt:="Not found", Title:="Finder"
    Exit Sub
Else
    Set Found = tempCell
    Set FoundRange = Found
End If
Do
    Set tempCell = Cells.FindNext(After:=Found)
    If Found.Row >= tempCell.Row Then Exit Do
    Set Found = tempCell
    Set FoundRange = Application.Union(FoundRange, Found)
Loop
FoundRange.Interior.ColorIndex = 6
FoundRange.Font.ColorIndex = 3
End Sub
 
Upvote 0
Hello Mr. Vog,
Thanks for the quick reply I copied your code and then using Find And Replace
entered the roster code and then clicked find it found the number as desired but did not change the colour .

Please help
 
Upvote 0
I assume that you entered the code in a normal module (ALT + F11, Insert > Module).

Then Tools > Macro > Macros, highlight FindHighlight and click Run. When prompted enter the code number and click OK.
 
Upvote 0
Do I have to complete Tools > Macro > Macros, highlight FindHighlight and click Run. the following procedure every time I OK'ed the tab this will take more time as I have more than 4000 thousand hard copies to be checked
 
Upvote 0
Tools > Macro > Macros, highlight FindHighlight, click the Options button and enter a keyboard shortcut.
 
Upvote 0
Sir,

I Am using office 2007 and it doesn't have a option menu in the Tools > Macro > Macros, highlight FindHighlight tab
 
Upvote 0
Click the Office button (top left), click Excel Options then click Show Developer tab in the Ribbon and click OK.

On the developer tab, click Macros, highlight FindHighlight and so on.
 
Upvote 0
Thanks Mr. Vog I found The tab And Gave a keyboard short-cut and is working as I wished Thanks A Lot

Regards
Jackt05
 
Upvote 0
Hello Mr. Vog.

After using the code for a while I found out a problem that if I enter my roster code No. 905 and pressed enter all the nos. starting with 905 for eg. 90504 or 90512 etc. are also highlighted which causes confusion as they are marked even if I don't want to mark them.

and the cell is not selected or the cursor does not show the cell which is found.

Please solve the problem if possible

Regards Jackt05
 
Upvote 0

Forum statistics

Threads
1,213,551
Messages
6,114,267
Members
448,558
Latest member
aivin

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top