+ Reply to Thread
Results 1 to 2 of 2

Get data from a fixed length of range, but the range is dynamic

  1. #1
    Registered User
    Join Date
    10-31-2017
    Location
    Unknown
    MS-Off Ver
    2016
    Posts
    1

    Lightbulb Get data from a fixed length of range, but the range is dynamic

    Hi all,

    I would like to ask something about getting data from a range with a fixed length, for example 10, but the range will have to be dynamic (I know I sound crazy now, but please bear with me for another two minutes with the example below).

    range.PNG

    In this tab, I have data from a table starting from column D of 2004, to column P, 2016. The table is fixed to this column in this worksheet, so it can only expand by going to column Q, 2017, and then column R, 2018, etc.

    I am getting data from one tab, and then plotting a chart in another tab. However, each time I would only need a series of 10 years, and in this case, from 2007 to 2016.

    I don't want to use "$" to set a fixed range, because then every time when the table is extended with one more column, the range will have to be re-drawn, and this can be very tedious.

    I don't want to use offset() plus counta() either, because the range of data I need does not grow as the table increases its size, but it has a fixed length of 10.

    I cannot easily have some search criteria for the year "2016", because there are several tables in parallel (for example another table with the same dimension, starting from column S), and looking for "2016" in a certain row might not always return the right column number.

    Hope this is all clear. Could anybody suggest anything? VBA or formula are both welcome! Thanks a lot!
    Last edited by ssyu28; 03-12-2018 at 12:50 PM.

  2. #2
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,611

    Re: Get data from a fixed length of range, but the range is dynamic

    (How to) Upload a Workbook directly to the Forum
    (please do not post pictures or links to worksheets)
    • Click Advanced next to Quick Post button at the bottom right of the editor box.
    • Scroll down until you see "Manage Attachments",
    • Click the "Choose" button at the upper left (upload from your computer).
    • Select your file, click "open", click "upload"
    • Once the upload is completed the file name will appear below the input boxes in this window.
    • Close the Attachment Manager window.
    • Click "Submit Reply"
    Note: Please do not attach password protected workbooks/worksheets
    Ensure to disable any Workbook Open/Autorun macros before attaching!
    Ben Van Johnson

+ 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] Fixed-length dynamic array: rolling computation
    By marcobm in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-17-2013, 01:15 PM
  2. [SOLVED] CountIF for dynamic length column using criteria of Named Range
    By saber0091 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-04-2013, 02:04 PM
  3. How to reference a formula to a Non-Fixed Range Length
    By BEEJAY in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 03-14-2012, 02:38 PM
  4. Select a range (block) below a non-fixed column length
    By BEEJAY in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-14-2012, 12:44 PM
  5. How to return sum of a range with fixed starting cell and variable length
    By jaskeerat in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-05-2011, 05:00 AM
  6. Dynamic Range of Columns with fixed Rows
    By nms2130 in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 01-05-2009, 05:24 PM
  7. [SOLVED] Zero Length Dynamic Range
    By Ken McLennan in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-15-2005, 07:06 PM

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