Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Find variable in a sheet
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! |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Find variable in a sheet
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 -- HTH... Jim Thomlinson "Sean Timmons" wrote: 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! |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Find variable in a sheet
There it is! Thank you much! Knew I was thinking too hard!
"Jim Thomlinson" wrote: 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 -- HTH... Jim Thomlinson "Sean Timmons" wrote: 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! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How To make a sheet reference Variable (eq: sum(sheet!D2:H2)) | Excel Discussion (Misc queries) | |||
passing a variable from sheet to form to another sheet | Excel Programming | |||
selecting sheet name in another workbook by variable (same sheet name) | Excel Programming | |||
variable in a link where the variable is the name of the sheet | Excel Worksheet Functions | |||
Cells.Find error Object variable or With block variable not set | Excel Programming |