#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 40
Default VBA Cell Address

I run a macro to find a value/text in a spread sheet. Instead of getting the
value from that cell, I want the address. Is there code that can do this?
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 168
Default VBA Cell Address

instead of .value, use .address


"scottfoxall" wrote in message
...
I run a macro to find a value/text in a spread sheet. Instead of getting
the
value from that cell, I want the address. Is there code that can do this?



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5
Default VBA Cell Address

This code looks for the string "asdf" in the current worksheet and
displays a message box with the address when it is found. If the
string is not found it advises the user, as well. You can substitute
your search string as a variable or as a hardcoded entry.

Sub Find()
On Error GoTo NotFound:
Cells.Find(What:="asdf", After:=ActiveCell, LookIn:=xlFormulas,
LookAt _
:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext,
MatchCase:= _
False, SearchFormat:=False).Activate

MsgBox ActiveCell.Address
End

NotFound:
MsgBox ("Search target not found.")

End Sub

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 40
Default VBA Cell Address

Thankyou. & rated

"PCLIVE" wrote:

instead of .value, use .address


"scottfoxall" wrote in message
...
I run a macro to find a value/text in a spread sheet. Instead of getting
the
value from that cell, I want the address. Is there code that can do this?




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
Address of Maximum value in Cell Session101 Excel Worksheet Functions 1 April 12th 06 09:06 PM
Insert Cell Contents in middle of web address Jetheat Excel Discussion (Misc queries) 2 March 5th 06 07:18 PM
Replace a spreadsheets named cells/ranges with exact cell address. David McRitchie Excel Discussion (Misc queries) 0 September 28th 05 08:59 PM
Copy cell format to cell on another worksht and update automatical kevinm Excel Worksheet Functions 21 May 19th 05 11:07 AM
How do I find the contents of a cell using the "ADDRESS" function. sweeney Excel Worksheet Functions 2 April 5th 05 03:23 AM


All times are GMT +1. The time now is 12:31 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"