Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,696
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,696
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How To make a sheet reference Variable (eq: sum(sheet!D2:H2)) John Linker Excel Discussion (Misc queries) 3 June 16th 08 11:29 PM
passing a variable from sheet to form to another sheet anny Excel Programming 2 May 7th 06 11:45 PM
selecting sheet name in another workbook by variable (same sheet name) Craig[_24_] Excel Programming 1 April 25th 06 05:45 PM
variable in a link where the variable is the name of the sheet darrelly Excel Worksheet Functions 1 October 7th 05 08:24 AM
Cells.Find error Object variable or With block variable not set Peter[_21_] Excel Programming 2 May 8th 04 02:15 PM


All times are GMT +1. The time now is 02:46 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"