+ Reply to Thread
Results 1 to 6 of 6

trying VBA code to get specific data for unique IDs on specific date from date range

  1. #1
    Forum Contributor
    Join Date
    05-13-2019
    Location
    Halifax, Canada
    MS-Off Ver
    2016
    Posts
    176

    Smile trying VBA code to get specific data for unique IDs on specific date from date range

    Hi every one,

    I am trying to write a VBA code from a small set of data to get a "NetAmount" on specific date, let's say, on 25th June 2018, for all "ID"s (unique values). I am attaching the file for your reference.

    IDs have transaction history, which are reflected by their repetition. The total number of unique values is 138 and have a start date from 2016-07-17. What could be the best possible way to get those values?

    Asset_Liability.xlsm

    Roshan Shakya

  2. #2
    Forum Expert KOKOSEK's Avatar
    Join Date
    08-03-2018
    Location
    Pole in Yorkshire, UK
    MS-Off Ver
    365/2013
    Posts
    2,742

    Re: trying VBA code to get specific data for unique IDs on specific date from date range

    For 25 June 2018 there is no data.
    On UBSD sheet required data in D2
    and

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Happy with my answer * Add Reputation.
    If You are happy with solution, please use Thread tools and mark thread as SOLVED.

  3. #3
    Forum Contributor
    Join Date
    05-13-2019
    Location
    Halifax, Canada
    MS-Off Ver
    2016
    Posts
    176

    Re: trying VBA code to get specific data for unique IDs on specific date from date range

    Thank you very much Kokosek,

    The solution is very close but maybe I did not clarify properly in my post. The start date and end date are the dates when the NetAmount was effective, so that means there were effective values on 2018-06-28. Let's take this one instance:

    ID start_date end_date asset_value liability_value NetAmount
    99ABC3100005005 2018-06-24 2018-06-28 1348409.06 0 -1348409.06

    So on 2018-06-25, the effective value of ID 99ABC3100005005 was -1,348,409.06.

  4. #4
    Forum Expert KOKOSEK's Avatar
    Join Date
    08-03-2018
    Location
    Pole in Yorkshire, UK
    MS-Off Ver
    365/2013
    Posts
    2,742

    Re: trying VBA code to get specific data for unique IDs on specific date from date range

    Probably I did not understand correctly.
    Check this file then.
    Attached Files Attached Files

  5. #5
    Forum Contributor
    Join Date
    05-13-2019
    Location
    Halifax, Canada
    MS-Off Ver
    2016
    Posts
    176

    Re: trying VBA code to get specific data for unique IDs on specific date from date range

    Kokosek,

    It was an excellent piece of code.

    Thank you

  6. #6
    Forum Expert KOKOSEK's Avatar
    Join Date
    08-03-2018
    Location
    Pole in Yorkshire, UK
    MS-Off Ver
    365/2013
    Posts
    2,742

    Re: trying VBA code to get specific data for unique IDs on specific date from date range

    You welcome.
    If You are happy with solution, please use Thread tools and mark thread as SOLVED.
    Thanks for rep.

+ 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. Replies: 4
    Last Post: 03-21-2018, 09:25 AM
  2. [SOLVED] Macro for specific column for specific date range
    By romandotcom in forum Excel General
    Replies: 2
    Last Post: 02-03-2016, 08:51 AM
  3. [SOLVED] Altering Code to Change Date Value on Row Updated (Want to Set a Specific Range)
    By nKife in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-19-2015, 05:11 PM
  4. Copy range to specific column with specific date with macro
    By SEERC in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-29-2015, 03:09 AM
  5. [SOLVED] Count cells within a specific date range that contain a specific word
    By oneillp1 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 07-23-2014, 08:34 AM
  6. Copy and paste specific range to date specific range in alternate sheet
    By alanalmarza in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-21-2013, 08:29 AM
  7. Replies: 3
    Last Post: 03-08-2012, 01:07 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