+ Reply to Thread
Results 1 to 9 of 9

row and column address of selected range

  1. #1
    Forum Contributor
    Join Date
    05-13-2019
    Location
    Halifax, Canada
    MS-Off Ver
    2016
    Posts
    176

    row and column address of selected range

    Hi gurus,

    I have selected range stored in range variable. The selection is user determinable. I am trying to identify row and column addresses of first cell in the range and last cell in the range. Can you please suggest code for this?

    I appreciate your advices.

    Thank you
    Roshan

  2. #2
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: row and column address of selected range

    Please Login or Register  to view this content.
    My General Rules if you want my help. Not aimed at any person in particular:

    1. Please Make Requests not demands, none of us get paid here.

    2. Check back on your post regularly. I will not return to a post after 4 days.
    If it is not important to you then it definitely is not important to me.

  3. #3
    Forum Guru
    Join Date
    04-23-2012
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 365
    Posts
    2,416

    Re: row and column address of selected range

    Let's say your Range variable is named Rng, then the addresses you asked for are...

    First Cell: Rng(1).Address

    Last Cell: Rng(Rng.Count).Address

    If you want to skip the variable and use the selection directly, then...

    First Cell: Selection(1).Address

    Last Cell: Selection(Selection.Count).Address
    Last edited by Rick Rothstein; 01-22-2021 at 07:30 PM.

  4. #4
    Forum Contributor
    Join Date
    01-02-2020
    Location
    Idaho, USA
    MS-Off Ver
    365
    Posts
    273

    Re: row and column address of selected range

    Hello Roshan,

    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    01-02-2020
    Location
    Idaho, USA
    MS-Off Ver
    365
    Posts
    273

    Re: row and column address of selected range

    Or if you have the selected range stored in a variable, then assuming r is the range variable you could use this:

    Please Login or Register  to view this content.

  6. #6
    Forum Contributor
    Join Date
    01-02-2020
    Location
    Idaho, USA
    MS-Off Ver
    365
    Posts
    273

    Re: row and column address of selected range

    Looks like Ricks is the shortest and best way here though :-)

  7. #7
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: row and column address of selected range

    Thanks Rick.

    I never knew about that.

    Please Login or Register  to view this content.

  8. #8
    Forum Contributor
    Join Date
    05-13-2019
    Location
    Halifax, Canada
    MS-Off Ver
    2016
    Posts
    176

    Re: row and column address of selected range

    Thank you all.

  9. #9
    Forum Guru
    Join Date
    04-23-2012
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 365
    Posts
    2,416

    Re: row and column address of selected range

    Quote Originally Posted by Roshan.Shakya View Post
    Thank you all.
    You are quite welcome... and thank you for the Reputation Points.

+ 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. [SOLVED] Get column address during loop and set union non contiguous range
    By sintek in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-18-2018, 07:35 AM
  2. [SOLVED] address of column of range as a string
    By tmallin in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-16-2016, 11:33 AM
  3. to get address of selected range of excel worksheet from Word VBA?
    By vsprybhanu in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-24-2015, 12:11 AM
  4. Replies: 0
    Last Post: 08-10-2012, 12:55 PM
  5. [SOLVED] Finding a value within the defined column address of a specific range
    By mike ryan in forum Excel General
    Replies: 5
    Last Post: 07-05-2012, 06:03 AM
  6. Replies: 1
    Last Post: 03-08-2012, 01:57 PM
  7. How do I convert a selected Cell address in a Range to Values?
    By MichaelC in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-10-2005, 09:05 AM

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