Find variable in a sheet

S

Sean Timmons

This cannot be hard. I don't know why I can't figure it out.

I am assigning a value to a variable based on a sheet named Rep and then I
want to find this value in another sheet, Map.

I tried using the Cells.Find(What:=VariableName, etc.) but it chokes on me.
I verified the variable is populated properly by using a message box. What is
the code to find a variable? Ack!
 
J

Jim Thomlinson

Generally speaking you want something like this...

Dim rngFound As Range

Set rngFound = Sheets("Maps").Cells.Find(What:=MyString, _
LookAt:=xlPart, _
LookIn:=xlFormulas, _
MatchCase:=False)

If Not rngFound Is Nothing Then MsgBox rngFound.Address
 

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

Top