+ Reply to Thread
Results 1 to 8 of 8

VBA: Help setting up a history table with variables.

  1. #1
    Registered User
    Join Date
    12-22-2014
    Location
    Netherlands
    MS-Off Ver
    O365
    Posts
    58

    VBA: Help setting up a history table with variables.

    Hi There,

    Thanks for checking my post!.

    I would like to create a history sheet, based on information of a source that updates daily.
    there are a couple of variables which I just can't wrap my head around, I have been sleeping really bad for days now...

    This is the situation:

    "Source that updates daily" is a data set that comes from the ERP System (see workbook attached)
    The ID is a production order and the date is the day it should be completed.
    Because the Date of production can shift due to sickness or other things, I would like to know how many day's it shifted from the last entry(I will do that via excel)

    I will also explain what exactly needs to happen:

    Lookup each ID in history, If not found -> make a record in History and Offset the Date beside it.

    Next: If a match was found inside history, check if the date in the source Equals the last entry inside History.
    If the date is the same,
    Do nothing

    If the date is not the same, Offset the new known date beside the old date cell.

    than the cleanup of History
    If ID in history is not found inside the source, Delete the ID and all the dates stored beside it.

    I Can explain what I have been trying to do:
    This is all I have because I keep getting stuck with what method to use best/trying to make the method work and fail.

    Please help I'm exhausted!

    Please Login or Register  to view this content.
    Attached Files Attached Files

  2. #2
    Forum Expert nankw83's Avatar
    Join Date
    08-31-2015
    Location
    Kuwait
    MS-Off Ver
    365
    Posts
    1,712

    Re: VBA: Help setting up a history table with variables.

    Hi Desotronics,

    Give the below macro a try on a copy of your file ...
    Please Login or Register  to view this content.
    If I was able to help, you can thank me by clicking the * Add Reputation under my user name

  3. #3
    Registered User
    Join Date
    12-22-2014
    Location
    Netherlands
    MS-Off Ver
    O365
    Posts
    58

    Re: VBA: Help setting up a history table with variables.

    wow thanks man, for taking the time!
    this is incredible.!

    Many, many thanks!

  4. #4
    Forum Expert nankw83's Avatar
    Join Date
    08-31-2015
    Location
    Kuwait
    MS-Off Ver
    365
    Posts
    1,712

    Re: VBA: Help setting up a history table with variables.

    Glad to help & thanks for the added Rep. points

  5. #5
    Forum Expert nankw83's Avatar
    Join Date
    08-31-2015
    Location
    Kuwait
    MS-Off Ver
    365
    Posts
    1,712

    Re: VBA: Help setting up a history table with variables.

    If that takes care of your original question, please take a moment & mark this thread as [SOLVED] from the Thread Tools above your first post

  6. #6
    Registered User
    Join Date
    12-22-2014
    Location
    Netherlands
    MS-Off Ver
    O365
    Posts
    58

    Re: VBA: Help setting up a history table with variables.

    Done! thanks so much again !

    may life give you all the best

  7. #7
    Forum Contributor
    Join Date
    11-20-2007
    Location
    Felixstowe, England
    MS-Off Ver
    Excel 2013, 2019
    Posts
    217

    Re: VBA: Help setting up a history table with variables.

    Oh, already solved.
    Last edited by GlennUK; 02-26-2021 at 04:31 PM.

  8. #8
    Registered User
    Join Date
    12-22-2014
    Location
    Netherlands
    MS-Off Ver
    O365
    Posts
    58

    Re: VBA: Help setting up a history table with variables.

    the piece of code provided by nankw83 is perfect.
    this is solved. thanks for taking the time to respond

+ 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] Setting Variables - best practice
    By BremhillBob in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-15-2014, 03:15 PM
  2. Setting variables from table as table headers
    By Slampamper in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 12-05-2013, 10:48 AM
  3. Setting variables
    By clueless2 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-23-2013, 04:59 AM
  4. Populate History Sheet from Custom function Variables (vlookup)
    By exc4libur in forum Excel Programming / VBA / Macros
    Replies: 40
    Last Post: 04-14-2011, 10:25 AM
  5. Setting variables to a value
    By jerseyguy1996 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-20-2009, 12:12 PM
  6. [SOLVED] Setting several variables at the same time
    By BenderBender in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-28-2006, 04:55 PM
  7. Setting variables to Nothing
    By Matt Jensen in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-11-2005, 11: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