+ Reply to Thread
Results 1 to 5 of 5

Save dynamic ranges into Global array and return combined ranges

  1. #1
    Registered User
    Join Date
    10-12-2022
    Location
    Copenhagen
    MS-Off Ver
    365
    Posts
    24

    Save dynamic ranges into Global array and return combined ranges

    Hi VBA geniuses


    I have a table with data that i am filtering with the (=FILTER) function.

    Each time I have applied a filter ("A4 & "A6") I would like to save that range in a Global Array, and change the filter accordingly with a different setting for a new range to save.
    Once I am done with chosing filters and populating the Array, I would like to return the whole thing (combinedRanges) in another output range.

    I have written the following code, but it is not returning the desired outcome. I might have made it too complicated, however, im looking for any help you can give me.

    Column "E:I" and "K:M" is my source range
    Column "AC:Aj" is my destination range

    CODE:

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by Fishtail; 02-22-2023 at 10:12 PM.

  2. #2
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,711

    Re: Save dynamic ranges into Global array and return combined ranges

    Does it need to be Global ?
    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    10-12-2022
    Location
    Copenhagen
    MS-Off Ver
    365
    Posts
    24

    Re: Save dynamic ranges into Global array and return combined ranges

    Hi jindon

    Thanks for your reply. The code works, however, the output data gets overrided when I use the code for the second time.

    Im not sure it needs to be Global. Maybe I did not explain myself correctly.
    What I mean is that the populated cells in the array needs to stay everytime I use the sub-routine and be resized to fit the next range I wanna save. And only when I am ready to output, the saved ranges are returned to column AC:AJ.

    As explained, I would like to filter on my data using cell A4 and A6. Once filtered, I would like to save my range. This will be done multiple of times.


    Hope this makes sence.

  4. #4
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,711

    Re: Save dynamic ranges into Global array and return combined ranges

    Do you want it directly to output?
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    10-12-2022
    Location
    Copenhagen
    MS-Off Ver
    365
    Posts
    24

    Re: Save dynamic ranges into Global array and return combined ranges

    Thanks, jindon. This is really good stuff. Both subroutines are working.

    Have a nice weekend!

+ 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] Dynamic chart ranges without naming lots of ranges
    By benoj2005 in forum Excel Charting & Pivots
    Replies: 7
    Last Post: 12-21-2020, 04:30 AM
  2. [SOLVED] Use 2 Different Named Cell Ranges To Return Values From 1 Of the Ranges In Formula
    By DESSTRO in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 07-20-2017, 08:37 PM
  3. Dynamic ranges in array formulas.
    By smatchymo in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-03-2016, 07:59 AM
  4. Save Ranges in Array
    By h0ps in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-12-2014, 07:57 AM
  5. [SOLVED] VBA Code To Return The Number Of Columns Between Two Dynamic Ranges.
    By GEANZ in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-04-2013, 01:44 AM
  6. VBA Array formula for dynamic ranges
    By -nada- in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-25-2010, 07:41 AM
  7. Can you create dynamic named ranges containing array formulas?
    By Marie J-son in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-28-2006, 09:10 AM

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