Sub ABCFoundCell()

  Dim x As Range

  Set x = Cells.Find(What:="ABC", _
     After:=ActiveCell, LookIn:=xlFormulas, _
     LookAt:=xlPart, SearchOrder:=xlByRows, _
     SearchDirection:=xlNext, MatchCase:=False, _
     SearchFormat:=False)
  MsgBox "the cell address is : " & x.Address

End Sub



On Sat, Jan 22, 2011 at 4:56 AM, Mao <yanjiemao...@gmail.com> wrote:
>
> Hi there,
> I have a question about how to locate the address of the cell in VBA
> For example, I am looking for "ABC" in my sheet. By using FIND
> function, I got the location as A1.
> How could I write this location into one variable? So when later I am
> using ABC again, I could refer Range("A1") directly.
>
> Thanks
> Mao

-- 
----------------------------------------------------------------------------------
Some important links for excel users:
1. Follow us on TWITTER for tips tricks and links : 
http://twitter.com/exceldailytip
2. Join our LinkedIN group @ http://www.linkedin.com/groups?gid=1871310
3. Excel tutorials at http://www.excel-macros.blogspot.com
4. Learn VBA Macros at http://www.quickvba.blogspot.com
5. Excel Tips and Tricks at http://exceldailytip.blogspot.com
 
To post to this group, send email to excel-macros@googlegroups.com

<><><><><><><><><><><><><><><><><><><><><><>
Like our page on facebook , Just follow below link
http://www.facebook.com/discussexcel

Reply via email to