Check is a single row in Listobject is selected
Results 1 to 2 of 2

Thread: Check is a single row in Listobject is selected
Thanks Thanks: 0 Likes Likes: 0

  1. #1
    Board Regular
    Join Date
    Nov 2006
    Posts
    921
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Check is a single row in Listobject is selected

    I am looking for a way to check if the user has selected a single cell or single row within a Listobject. If this is the case, then I would like to return the value from Column 1 of the Listobject for the particular row.

    Not sure how to start with this one. any help is much appreciated.

    many thanks
    Andrew

  2. #2
    MrExcel MVP
    Moderator
    Fluff's Avatar
    Join Date
    Jun 2014
    Location
    Chippenham
    Posts
    27,051
    Post Thanks / Like
    Mentioned
    461 Post(s)
    Tagged
    46 Thread(s)

    Default Re: Check is a single row in Listobject is selected

    Maybe
    Code:
    Sub neojandre()
       Dim Tbl As ListObject
       On Error Resume Next
       Set Tbl = Selection.ListObject
       On Error GoTo 0
       If Not Tbl Is Nothing And Selection.Rows.Count = 1 Then
          MsgBox Intersect(Tbl.DataBodyRange.Columns(1), Selection.EntireRow)
       End If
    End Sub
    - Posting Data try one of these tools
    - Posting guidelines, forum rules and terms of use
    - Read the FAQs

    Running Office 365 on Win 10

Some videos you may like

User Tag List

Tags for this Thread

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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