Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 26
Default Finding a cell

If I wish to find a cell containing some text, how do I find it and then
place the grid reference in a variable.

Thanks Michael


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Finding a cell

the "grid reference" is in the variable rng

Dim rng as Range
sStr = "text"
set rng = Cells.find(what:=sStr, _
LookIn:=xlValues, LookAt:=xlPart)
if not rng is nothing then
msgbox rng.Address
else
msgbox sStr & " Not Found!"
End if

--
Regards,
Tom Ogilvy


"Himszy" wrote in message
.. .
If I wish to find a cell containing some text, how do I find it and then
place the grid reference in a variable.

Thanks Michael




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 26
Default Finding a cell

Thanks Tom


"Tom Ogilvy" wrote in message
...
the "grid reference" is in the variable rng

Dim rng as Range
sStr = "text"
set rng = Cells.find(what:=sStr, _
LookIn:=xlValues, LookAt:=xlPart)
if not rng is nothing then
msgbox rng.Address
else
msgbox sStr & " Not Found!"
End if

--
Regards,
Tom Ogilvy


"Himszy" wrote in message
.. .
If I wish to find a cell containing some text, how do I find it and then
place the grid reference in a variable.

Thanks Michael






  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 26
Default Finding a cell

Tom is there a way of removing the $ signs?

"Himszy" wrote in message
...
Thanks Tom


"Tom Ogilvy" wrote in message
...
the "grid reference" is in the variable rng

Dim rng as Range
sStr = "text"
set rng = Cells.find(what:=sStr, _
LookIn:=xlValues, LookAt:=xlPart)
if not rng is nothing then
msgbox rng.Address
else
msgbox sStr & " Not Found!"
End if

--
Regards,
Tom Ogilvy


"Himszy" wrote in message
.. .
If I wish to find a cell containing some text, how do I find it and

then
place the grid reference in a variable.

Thanks Michael








  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Finding a cell

Dim rng as Range
sStr = "text"
set rng = Cells.find(what:=sStr, _
LookIn:=xlValues, LookAt:=xlPart)
if not rng is nothing then
msgbox rng.Address(0,0)
else
msgbox sStr & " Not Found!"
End if

--
Regards,
Tom Ogilvy


"Himszy" wrote in message
...
Tom is there a way of removing the $ signs?

"Himszy" wrote in message
...
Thanks Tom


"Tom Ogilvy" wrote in message
...
the "grid reference" is in the variable rng

Dim rng as Range
sStr = "text"
set rng = Cells.find(what:=sStr, _
LookIn:=xlValues, LookAt:=xlPart)
if not rng is nothing then
msgbox rng.Address
else
msgbox sStr & " Not Found!"
End if

--
Regards,
Tom Ogilvy


"Himszy" wrote in message
.. .
If I wish to find a cell containing some text, how do I find it and

then
place the grid reference in a variable.

Thanks Michael










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
finding last non-blank cell and then copying it to the next cell mike_vr Excel Discussion (Misc queries) 0 January 17th 08 05:02 PM
Finding Corresponding Cell Value Ken Excel Discussion (Misc queries) 2 August 19th 07 03:49 PM
Finding last cell Jim[_2_] Excel Worksheet Functions 15 February 17th 07 07:45 PM
finding a cell rbekka33[_17_] Excel Programming 1 September 23rd 04 10:17 AM
Finding a cell Alan Excel Programming 5 July 22nd 03 06:25 PM


All times are GMT +1. The time now is 12:42 AM.

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"