+ Reply to Thread
Results 1 to 3 of 3

Get row/column number from text cell reference value.

  1. #1
    Registered User
    Join Date
    11-26-2013
    Location
    .
    MS-Off Ver
    Excel 2010
    Posts
    33

    Get row/column number from text cell reference value.

    Hello.

    I have a cell (in A1) which contains a dynamic text cell reference value (e.g. $B$2) based on the currently selected cell (done using below VBA).

    Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
    Range("A1").Value = ActiveCell.Address
    End Sub

    I want to create two additional cells (in cells B1 and C1) that will return the respective column (B1) and row (C1) numbers of whatever text cell value is in A1:

    For example if the value in A1 is:

    $B$2 - then B1 = 2, C1 = 2
    $E$10 - then B1 = 5, C1 = 10
    $Z$3 - then B1 = 26, C1 = 3

    Hope this makes sense.

    Thanks for any help.

  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: Get row/column number from text cell reference value.

    Column:
    =COLUMN(INDIRECT(A1&"1"))

    Row:
    =ROW(INDIRECT(A1))
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU

  3. #3
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Get row/column number from text cell reference value.

    Just change to

    Please Login or Register  to view this content.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 4
    Last Post: 10-17-2016, 05:20 PM
  2. Column number reference using cell reference
    By Fatrobo in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 06-16-2015, 12:50 AM
  3. how to reference cell value from column number and row number
    By jed38 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 02-11-2015, 07:37 PM
  4. [SOLVED] VLOOKUP formula, cell reference as column index number
    By Bobz1983 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-27-2014, 10:22 PM
  5. [SOLVED] VLOOKUP to reference cell, not column number
    By Prodschdler in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 10-18-2013, 02:27 PM
  6. Go to a cell in column, based on a reference number
    By Joshua@work in forum Excel General
    Replies: 5
    Last Post: 06-30-2010, 07:28 PM
  7. Insert a formula with relative cell reference based on a number in a column
    By Dcritelli in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 07-16-2007, 05:54 PM

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