+ Reply to Thread
Results 1 to 1 of 1

Referencing last column of a table within a formula / vba

  1. #1
    Registered User
    Join Date
    12-10-2016
    Location
    Birmingham, England
    MS-Off Ver
    2016
    Posts
    35

    Referencing last column of a table within a formula / vba

    Hi all,

    I've been creating a macro which enables me to create a table and add additional rows/columns on the click of command buttons. The table is used to track the hours and cost of labour on different jobs.

    The code is nearly functional, but I'm having trouble with the formula in a few cells. I'm using a SUMIF formula with structured table references, but when I add new columns, I'm not sure how to extend the last reference ([9]) to always be the last column of the table.

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    e.g. wrong, incomplete range
    Picture1.png

    e.g. correct, complete range
    Picture2.png

    (Note: I've posted this in the vba forum as the formula is added via vba, which may be a factor.)
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    [/FORMULA]
    Attached Files Attached Files

+ 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. [SOLVED] Help with formula referencing a variable table range
    By sryan429 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 11-27-2018, 10:21 AM
  2. [SOLVED] Referencing different column in same row in a table
    By jamief in forum Excel General
    Replies: 3
    Last Post: 01-21-2018, 05:15 PM
  3. [SOLVED] COUNTIFS formula for multiple criteria referencing a formatted table
    By jholiday78 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 08-31-2015, 05:15 PM
  4. Formula referencing cells in a pivot table
    By DLStryker in forum Excel General
    Replies: 3
    Last Post: 09-24-2014, 05:57 PM
  5. Replies: 6
    Last Post: 03-20-2013, 09:37 AM
  6. Using a formula referencing a table with a cell reference
    By heatherromo in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 02-19-2013, 04:36 PM
  7. referencing one column in a formula and changing it.
    By eguru in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-19-2010, 02:38 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