+ Reply to Thread
Results 1 to 4 of 4

Row Selection

  1. #1
    Forum Contributor
    Join Date
    03-24-2005
    Location
    Wisconsin
    MS-Off Ver
    2007
    Posts
    378

    Row Selection

    I am looking at how to find the first row in a selection when the user selects a range of rows.

    If a user selects rows 2 through 800, I need to know that row 2 is the first row in the range.

    If I use:

    Dim myAddress as string
    myaddress = selection.address

    I get my Address as "$2:$800"

    How is the most efficient way of identifying the first row as row 2?
    Thanks!
    Dennis

    I am using Windows 7 and Office 2007, all of my posts are based on this.

  2. #2
    Abode
    Guest

    RE: Row Selection

    Selection.Row Should do it.

    "DCSwearingen" wrote:

    >
    > I am looking at how to find the first row in a selection when the user
    > selects a range of rows.
    >
    > If a user selects rows 2 through 800, I need to know that row 2 is the
    > first row in the range.
    >
    > If I use:
    >
    > Dim myAddress as string
    > myaddress = selection.address
    >
    > I get my Address as "$2:$800"
    >
    > How is the most efficient way of identifying the first row as row 2?
    >
    >
    > --
    > DCSwearingen
    >
    >
    > ------------------------------------------------------------------------
    > DCSwearingen's Profile: http://www.excelforum.com/member.php...o&userid=21506
    > View this thread: http://www.excelforum.com/showthread...hreadid=542535
    >
    >


  3. #3
    Kevin B
    Guest

    RE: Row Selection

    The following function returns the active cell address:

    Function WhereAmI() As String

    Dim strCell As String

    strCell = ActiveCell.Address
    'Omit the following line if you want an absolute address
    strCell = Application.ConvertFormula(strCell, xlA1, xlA1, xlRelative)

    WhereAmI = strCell

    End Function

    --
    Kevin Backmann


    "DCSwearingen" wrote:

    >
    > I am looking at how to find the first row in a selection when the user
    > selects a range of rows.
    >
    > If a user selects rows 2 through 800, I need to know that row 2 is the
    > first row in the range.
    >
    > If I use:
    >
    > Dim myAddress as string
    > myaddress = selection.address
    >
    > I get my Address as "$2:$800"
    >
    > How is the most efficient way of identifying the first row as row 2?
    >
    >
    > --
    > DCSwearingen
    >
    >
    > ------------------------------------------------------------------------
    > DCSwearingen's Profile: http://www.excelforum.com/member.php...o&userid=21506
    > View this thread: http://www.excelforum.com/showthread...hreadid=542535
    >
    >


  4. #4
    Forum Contributor
    Join Date
    03-24-2005
    Location
    Wisconsin
    MS-Off Ver
    2007
    Posts
    378

    Many Thanks! To Kevin B & Adobe!!

    Both tips will be useful in the future!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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