+ Reply to Thread
Results 1 to 3 of 3

Getting the row and colum of a table instead of the worksheet

  1. #1
    Forum Contributor
    Join Date
    03-05-2007
    Location
    Falmouth, VA now, Palm Bay, FL for 2 yrs, was Colorado Springs, CO for ten years; Cedark Park, TX; Zeeland, MI; Wilmette, IL; Princeton Junction, NJ; NY, NY
    MS-Off Ver
    365
    Posts
    579

    Getting the row and colum of a table instead of the worksheet

    Thank you for considering my problem!

    It has been too long since i was writing code and i'm afraid my mind has stored that knowledge in some dusty old closet.


    Let's say i have a defined listobject table named tblInfo with listcolumns named "One", "Two" and "Three".

    Listcolumn "One" is in the worksheet's column 11 and the header row is in worksheet row 12.


    Part 1:
    How do i get a return value of 3 when looking for where listcolumn "Three" is in "tblInfo" instead of 13, being the worksheet column?

    Part 2:
    Let us say that the value "SailBoat" is in listcolumn "Three", in the 5th row of the table, being the fourth databody row.

    How do i get a return of either 4 (relative to databody) or 5 (relative to the entire table) as the row "SailBoat" is in, instead of worksheet row 16?


    This is so i can specifically address cells(3,5) (relative to the entire table) in tblInfo, i.e.; ActiveWorksheet.Listobjects("tblInfo").Range.Cells(3,5)

    I know i can use the row and column to address that same cell using the entire worksheet as my basis, but this seems a bit, well, indiscriminate, and though i could subtract from the normal Row and Column figures the row and column that the upper left corner of my table is located in, that seems a little convoluted.

    I apologize for how basic this question must be - it seems like it would be something very obvious that i must be blanking on, but so far my internet searches didn't show a simple answer.

    Best Regards,
    -Bruce

  2. #2
    Forum Expert WideBoyDixon's Avatar
    Join Date
    10-03-2016
    Location
    Sheffield, UK
    MS-Off Ver
    365
    Posts
    2,182

    Re: Getting the row and colum of a table instead of the worksheet

    You can use the HeaderRowRange and DataBodyRange along with Application.Match like this:

    Please Login or Register  to view this content.
    WBD
    Office 365 on Windows 11, looking for rep!

  3. #3
    Forum Contributor
    Join Date
    03-05-2007
    Location
    Falmouth, VA now, Palm Bay, FL for 2 yrs, was Colorado Springs, CO for ten years; Cedark Park, TX; Zeeland, MI; Wilmette, IL; Princeton Junction, NJ; NY, NY
    MS-Off Ver
    365
    Posts
    579

    Re: Getting the row and colum of a table instead of the worksheet

    Thank you!

    It seemed to me natural that since we have a listobject with listcolumns and listrows, we would have a direct means of getting the ordinal position of each and using that number to specify a location, but if we need use Match, then obviously that which i thought would be natural isn't!

+ 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: 1
    Last Post: 02-03-2022, 10:59 AM
  2. Convert a mutli colum Multi roy table to a 3 column table
    By stratis63 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-22-2015, 11:30 AM
  3. Copying Column from separate tabs in same worksheet into another worksheet with each colum
    By campbellbyte in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-31-2014, 12:30 AM
  4. Export Colum to txt for each worksheet
    By [email protected] in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 05-11-2014, 02:53 AM
  5. [SOLVED] X in colum A on worksheet 1 will populate different worksheet with line info
    By HelenClark in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-26-2014, 05:26 AM
  6. Formula Help matchin colum a with colum b to display colum c
    By dbe82 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 05-08-2013, 10:11 PM
  7. paste to next free colum on new Worksheet
    By Ralph in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-22-2006, 07:35 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