+ Reply to Thread
Results 1 to 7 of 7

how to use a table column name instead of the column name so replace range with listobject

  1. #1
    Valued Forum Contributor dmcgov's Avatar
    Join Date
    11-11-2015
    Location
    Florida, USA
    MS-Off Ver
    Office 365 Business
    Posts
    1,518

    how to use a table column name instead of the column name so replace range with listobject

    im working on this post and this is the question that i have.

    how can i refer to a column name based on its table column name and not a column letter. this is the syntax that i have that needs to get replace.

    Please Login or Register  to view this content.
    so i tried this:

    Please Login or Register  to view this content.
    so what is the syntax for changing column "T" to "[@[Central Reviewer]]"

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: how to use a table column name instead of the column name so replace range with listob

    Here are two good resources for VBA syntax with tables.

    Working With Tables In Excel 2013, 2010 And 2007 (VBA)

    The VBA Guide To ListObject Excel Tables



    You probably don't need the .End(xlUp) part when using a Table, though I don't know what ultimately you want to do.

    This will select a column By header name

    Please Login or Register  to view this content.
    Last edited by AlphaFrog; 09-01-2017 at 04:11 PM. Reason: sp
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  3. #3
    Valued Forum Contributor dmcgov's Avatar
    Join Date
    11-11-2015
    Location
    Florida, USA
    MS-Off Ver
    Office 365 Business
    Posts
    1,518

    Re: how to use a table column name instead of the column name so replace range with listob

    ok so first thanks for the links, i have frequented them as of late. but it always helps to refresh.

    so i changed this line:

    Please Login or Register  to view this content.
    to this:

    Please Login or Register  to view this content.
    so all his code did for this variable was find the last row in t. unfortunately mine give the last row in the table. how to make it look at column t's table column name?

    so how can i use the listobject to find the last cell that has data in the table based on its column name?

    also what is the syntax for finding the value of a cell in a table based on it's row?

  4. #4
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: how to use a table column name instead of the column name so replace range with listob

    The table column header is "Central Reviewer"

    fCT is the row number of the last used cell in the column

    fCTValue is the value of the last used cell in the column


    Please Login or Register  to view this content.

  5. #5
    Valued Forum Contributor dmcgov's Avatar
    Join Date
    11-11-2015
    Location
    Florida, USA
    MS-Off Ver
    Office 365 Business
    Posts
    1,518

    Re: how to use a table column name instead of the column name so replace range with listob

    thanks first of all for commenting on this thread. but it seems that this last edit (to the OP's source code, thread found here), is beyond me. can you look at this thread and see if there is an easy way to code this for table column names? i ask cause i can use this functionality in some of my existing macros.

  6. #6
    Valued Forum Contributor dmcgov's Avatar
    Join Date
    11-11-2015
    Location
    Florida, USA
    MS-Off Ver
    Office 365 Business
    Posts
    1,518

    Re: how to use a table column name instead of the column name so replace range with listob

    can you take a look at dangerdavesp's post? I dont know how to make his last request work, need a guru like you to fix.

    thanks

  7. #7
    Valued Forum Contributor dmcgov's Avatar
    Join Date
    11-11-2015
    Location
    Florida, USA
    MS-Off Ver
    Office 365 Business
    Posts
    1,518

    Re: how to use a table column name instead of the column name so replace range with listob

    here is dave's new post

+ 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. Rearrange Table Column (i.e. ListObject.ListColumns...)
    By kestefon in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-03-2018, 10:09 AM
  2. [SOLVED] Copy filtered column of ListObject to another ListObject
    By snapfade in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-15-2016, 04:00 PM
  3. Deleting table (listobject) range without activating
    By BuZZarD73 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-04-2016, 05:48 PM
  4. [SOLVED] How to replace table column tags
    By JayeshG in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-12-2014, 03:59 PM
  5. ListObject Total Each Column
    By goss in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-19-2013, 01:59 AM
  6. Replies: 11
    Last Post: 07-18-2013, 05:14 PM
  7. replace a range of values in a column
    By orville.jackson in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-25-2008, 08:56 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