![]() |
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? |
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? |
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 |
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? |
All times are GMT +1. The time now is 03:07 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com