Using a cell reference for find?

  • Thread starter Thread starter Paul B
  • Start date Start date
P

Paul B

Set rng = Columns(1).Find(What:="Paul")
Using this to find the row with Paul in column 1 works fine , is there
anyway to use a cell reference for this, I need the Find What to look in
cell AF2 can this be done? So if Paul was in AF2 it would still find it in
column 1.
Something like this, but of course this does not work.
Set rng = Columns(1).Find(What:= Range("AF2"))


Thanks Paul B
 
Paul,

You need to use the .Value property:
Set rng = Columns(1).Find(What:=Range("AF2").Value)

HTH,
Bernie
MS Excel MVP
 
Bernie, thanks
Paul B
Bernie Deitrick said:
Paul,

You need to use the .Value property:
Set rng = Columns(1).Find(What:=Range("AF2").Value)

HTH,
Bernie
MS Excel MVP
 

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