+ Reply to Thread
Results 1 to 4 of 4

Populating a range from a recordset

  1. #1
    Registered User
    Join Date
    08-22-2016
    Location
    MTL, CA
    MS-Off Ver
    2013
    Posts
    60

    Populating a range from a recordset

    I want to populate a range B2 to the bottom right corner with the show recordset & results.

    It is possible for a given Wh & Per that there is no data.

    Although the Per in the recordset is YYYY/MM, the title row is actually a date with a custom format to look like YYYY/MM, but the source is date calculated by the substraction of months (example: =EDATE(TODAY(),-2) or 2 months ago)

    What would be the best programming approach?

    I was able to populate a different column (not shown) for a simple serie of cells.


    Please Login or Register  to view this content.
    For whatever reason (and time of the day), I am a bit lost to do it in 2D.

    ExcelForum2.png

    EDIT: I forgot to mention that the warehouses in the column A are not fixed and are there descending by quantity on hand (not shown). I can have a warehouse in the recordset not showing in the table.
    Attached Files Attached Files
    Last edited by Saintor; 04-29-2020 at 10:23 PM.

  2. #2
    Forum Expert Bob Phillips's Avatar
    Join Date
    09-03-2005
    Location
    Wessex
    MS-Off Ver
    Office 2003, 2010, 2013, 2016, 365
    Posts
    3,284

    Re: Populating a range from a recordset

    Try this formula

    =SUMPRODUCT(--($C$14:$C$38=TEXT(B$1,"yyyy/mm")),--($B$14:$B$38=$A2),$D$14:$D$38)

  3. #3
    Registered User
    Join Date
    08-22-2016
    Location
    MTL, CA
    MS-Off Ver
    2013
    Posts
    60

    Re: Populating a range from a recordset

    Sorry if it was misleading, but I need to populate the table direct from the recordset (as per my title) , not from a copy of the results (row 14-38).

  4. #4
    Forum Expert Bob Phillips's Avatar
    Join Date
    09-03-2005
    Location
    Wessex
    MS-Off Ver
    Office 2003, 2010, 2013, 2016, 365
    Posts
    3,284

    Re: Populating a range from a recordset

    It would be far simpler to dump the recordset to a sheet, maybe hidden, and use formulas.

+ 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. Open another recordset within current recordset vba
    By aman1234 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-02-2015, 04:32 AM
  2. [SOLVED] dynamic named range not populating combo box list if range = single cell
    By HeyInKy in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 10-24-2014, 05:27 PM
  3. Subscript out of range error while populating array from range.
    By Aussiexile in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-04-2010, 02:22 AM
  4. Recordset's RowID as part of Recordset
    By Trip in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-22-2005, 06:55 PM
  5. [SOLVED] Populating a multi column listbox with ADO Recordset
    By Paul Faulkner in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-16-2005, 03:05 PM
  6. Populating a range dynamically from another range
    By Kolyana in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-26-2005, 01:44 PM
  7. [SOLVED] How to populate Excel Range from Access RecordSet?
    By deko in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 02-27-2005, 01:06 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