Find and display

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi all,

I'm currently using the code below to find specific data in a column in a
sheet. However, although it finds correctly, the whole column remains
highlighted which can make it difficult to see the cell found. Is there some
extra code I could add to highlight temporarily the cell found?

Columns(1).Select
Application.Dialogs(xlDialogFormulaFind).Show

Any suggestions much appreciated,

Richard.
 
Don't select the entire column, just the cell at the top.

Range("A1").Select
Application.Dialogs(xlDialogFormulaFind).Show

Mike F
 
I tried entering that, but then nothing is found! Surely it's only searching
cell A1 there? Of course, if I put in the range "A1:A400" it again finds the
item searched for, but still the whole range remains highlighted and I can't
see the single item highlighted!

Any further suggestions?

Richard.
 
You may only need to use a variation of the " Application.Goto Range" from
this.

Sub FindAndGoto()
Dim rngToSearch As Range
Dim rngFound As Range
Dim wks As Worksheet
Set wks = ActiveSheet
Set rngToSearch = Worksheets("sheet1").Range("A79:A1000")
Set rngFound = rngToSearch.Find(What:=wks.Range("$A$3"), _
LookAt:=xlPart, MatchCase:=False)
If Not rngFound Is Nothing Then
Application.Goto Range(rngFound.Address), True
Else
MsgBox "Not Found"
End If
End Sub
 
Ok, that's getting there, but it seems to search for only what is written in
Cell A3? Ideally I'd like to combine this code, which highlights the found
box, has a "not found" option (which is useful) with the first code that
brings up a Search Box and searches for whatever the user types into that
box, rather than them typing into a cell...

Can this be done?! Cheers for all the help,

Richard.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top