+ Reply to Thread
Results 1 to 3 of 3

VBA to Increment date until another cell = zero

  1. #1
    Registered User
    Join Date
    07-22-2015
    Location
    Northampton, UK
    MS-Off Ver
    Excel 2010
    Posts
    2

    VBA to Increment date until another cell = zero

    I need to set dates for about 1,000 tennis matches each year. For each date I currently type into the spreadsheet many checks are performed and it comes back with 1 in Col B for a problem or a zero if date is OK while Conditional formatting tells me what the problem is. This takes me a LONG time....

    So in simple terms I have a Match Date in Col A and Col B shows 1 if Match is Date is not suitable and Zero when it is OK. So I need a macro that increments the Match Date in Col A between Start Date and End Date while Col B = 1 then when Col B = Zero it moves onto the next line and repeats until all rows have a suitable date. For this example Col B can be Zero when Match Date = Target Date. The result here should all rows set to target Date but if I can see how this works then I can adapt it into my work.

    In the real sheet col B is the result of various checks to see if date is suitable so shows a zero for a good date and 1 for a bad date.

    Any help would be greatly appreciated.

    Fixed cells; Start Date = 7/4/15 End Date = 08/08/15 Target Date = 05/06/15

    Col A - Match Date Col B - Date NOT good = 1

  2. #2
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,609

    Re: VBA to Increment date until another cell = zero

    Surely, it can be done. No sample file attached, so very general concept, but if indeed in column B you have working formulas and dates shall go in A2:A100, shall work.
    Please Login or Register  to view this content.
    Best Regards,

    Kaper

  3. #3
    Registered User
    Join Date
    07-22-2015
    Location
    Northampton, UK
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: VBA to Increment date until another cell = zero

    Many thanks, that works. I think that would have taken me a long time to create successfully.
    If my Start Date and End Date are stored in cells D2 and D3 how is that shown in the code.
    Also if I want to store the 1 of my "Value = 1" in cell D4 so I can change it one place easily how would that be shown in the code. The more unsuitable the date is the higher number I get in Col B so playing with the threshold of 1 up and down could give me the best possible result even if not perfect.
    Again , many thanks....

+ 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] Control Button to increment by 1 and then select next cell in row to increment that cell
    By rammergu in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-19-2012, 07:35 PM
  2. [SOLVED] input date column A, increment B, select blank cell in D and input time. in a macro
    By jeffstu in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-19-2012, 11:19 AM
  3. Replies: 1
    Last Post: 12-15-2011, 05:32 AM
  4. Increment Date by 1
    By evenings in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-03-2010, 10:22 AM
  5. increment date by one day
    By emilis in forum Excel General
    Replies: 6
    Last Post: 07-22-2008, 07:25 PM
  6. Short date increment in VB
    By artsx in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-20-2008, 06:55 AM
  7. date increment how?
    By exolim in forum Excel General
    Replies: 3
    Last Post: 02-21-2008, 08:27 PM
  8. [SOLVED] FORMULA TO INCREMENT 25 MONTHS BASED ON A DATE CELL
    By SorianoP in forum Excel General
    Replies: 4
    Last Post: 08-14-2006, 06:50 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