+ Reply to Thread
Results 1 to 2 of 2

How can I find out which listobject row is selected?

  1. #1
    Forum Contributor
    Join Date
    05-30-2011
    Location
    Sweden
    MS-Off Ver
    Excel 2013
    Posts
    107

    How can I find out which listobject row is selected?

    The user selects a cell. I have figured out (with the help of the internet) how to test if the selected cell is part of a listobject:

    Function IsRangeInTable(rng As Range) As Boolean
    'Function returns true if active cell is in a table and
    'false if it isn't.

    'Test for table.
    'Statement produces error when active cell is not
    'in a table.
    On Error Resume Next
    IsRangeInTable = (rng.ListObject.Name <> "")
    On Error GoTo 0
    End Function

    But can I also find out which listrow is selected?

  2. #2
    Forum Contributor
    Join Date
    05-30-2011
    Location
    Sweden
    MS-Off Ver
    Excel 2013
    Posts
    107

    Re: How can I find out which listobject row is selected?

    I found a solution:

    lFirstTableRow = target.ListObject.ListRows(1).Range.Row
    lCurrentListRow = target.Row - lFirstTableRow + 1

+ 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. Use of ListObject
    By j_Southern in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 03-04-2013, 03:29 PM
  2. ListObject
    By costadina in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-24-2009, 08:20 PM
  3. ListObject Name ?
    By rvExcelNewTip in forum Excel General
    Replies: 10
    Last Post: 01-22-2007, 11:29 AM
  4. listobject issue
    By kevinc in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-26-2006, 09:30 AM
  5. [SOLVED] Events for listobject
    By sai in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-07-2005, 09:06 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