+ Reply to Thread
Results 1 to 5 of 5

Return R1C1 Address of a cell that contains specific text in Excel VBA

  1. #1
    Forum Contributor
    Join Date
    07-03-2012
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    139

    Return R1C1 Address of a cell that contains specific text in Excel VBA

    Hello All

    I need to find a way in VBA that will find the first cell on a sheet that contains text (say "By Focus") for example, and return the R1C1 address for that cell. I then need to assign a variable the value of that R1C1 address.

    I have scoured the interwebs looking for this answer and have not been able to find one.

    Any Thoughts?

  2. #2
    Forum Expert Ace_XL's Avatar
    Join Date
    06-04-2012
    Location
    UAE
    MS-Off Ver
    2016
    Posts
    6,074

    Re: Return R1C1 Address of a cell that contains specific text in Excel VBA

    Try this...

    Please Login or Register  to view this content.
    Life's a spreadsheet, Excel!
    Say thanks, Click *

  3. #3
    Forum Contributor
    Join Date
    07-03-2012
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    139

    Re: Return R1C1 Address of a cell that contains specific text in Excel VBA

    That returns $M$3, I would need this to return R3C13.

    Any idea how to return the RC values rather than the Column Letter addressing?

  4. #4
    Forum Expert Ace_XL's Avatar
    Join Date
    06-04-2012
    Location
    UAE
    MS-Off Ver
    2016
    Posts
    6,074

    Re: Return R1C1 Address of a cell that contains specific text in Excel VBA

    What do you intend to use the $M$3 for?

  5. #5
    Forum Contributor
    Join Date
    07-03-2012
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    139

    Re: Return R1C1 Address of a cell that contains specific text in Excel VBA

    I don't want to use the $M$3, I want the relative address R3C13 to be assigned to a variable then, use that in a IF THEN Statement

    For example:

    Dim Adr as String

    Set Adr = ( THIS IS WHERE I NEED TO FIND OUT HOW TO PULL THE R1C1 ADDRESS FOR THE CELL THAT CONTAINS "BY FOCUS")

    If Adr = R3C13 Then
    CODE TO BE RUN

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1