+ Reply to Thread
Results 1 to 7 of 7

VB Code to change date if more then certain entries

  1. #1
    Valued Forum Contributor
    Join Date
    01-18-2007
    Location
    Georgia
    MS-Off Ver
    2010
    Posts
    4,434

    VB Code to change date if more then certain entries

    Hello:

    Please refer to attached file.
    I have data as shown.
    I need VB Code to change the date (column A) of the last deposits to the next day if total # of deposits for single day is greater then 6.
    In this example
    Note : Look for text "Depsosit" in column C

    Date 1/2/2018 : Total # of deposits is 4 so this block is ok
    Date 1/5/2018 : Total # of deposits is 8 so need to chnage last 2 (8 minus 6) deposit to date 1/6/2018
    Date 1/10/2018 : Total # of deposits is 9 so need to chnage last 3 (9 minus 6) deposit to date 1/11/2018

    Let me know if you have any questions.
    Thanks.

    R
    Attached Files Attached Files

  2. #2
    Forum Expert nilem's Avatar
    Join Date
    10-22-2011
    Location
    Ufa, Russia
    MS-Off Ver
    2013
    Posts
    3,377

    Re: VB Code to change date if more then certain entries

    Hi Riz,
    try this
    Please Login or Register  to view this content.

  3. #3
    Forum Guru karedog's Avatar
    Join Date
    10-03-2014
    Location
    Indonesia
    MS-Off Ver
    2003
    Posts
    2,971

    Re: VB Code to change date if more then certain entries

    Maybe :
    Please Login or Register  to view this content.
    1. I care dog
    2. I am a loop maniac
    3. Forum rules link : Click here
    3.33. Don't forget to mark the thread as solved, this is important

  4. #4
    Valued Forum Contributor
    Join Date
    01-18-2007
    Location
    Georgia
    MS-Off Ver
    2010
    Posts
    4,434

    Re: VB Code to change date if more then certain entries

    Hello:

    Nilem: Your code change the date for only one Deposit, example: if i have same date say 9 times then your code change 1 of them to new date instead of 3 (Number greater then 6)...Would appreciate if you can modify the code to correct this problem.
    Please run the code to see yourself. If say 10 Deposits with same day then i need 6 deposit and 4 deposit to next day.
    Please see attached pic

    karedog: Great code, works with small modification as below at the end of the code

    Please Login or Register  to view this content.


    Once again thanks to both of you.

    Riz
    Attached Images Attached Images
    Last edited by rizmomin; 04-18-2018 at 10:36 AM.

  5. #5
    Forum Expert nilem's Avatar
    Join Date
    10-22-2011
    Location
    Ufa, Russia
    MS-Off Ver
    2013
    Posts
    3,377

    Re: VB Code to change date if more then certain entries

    Yes, it should be like this
    Please Login or Register  to view this content.
    instead of
    Please Login or Register  to view this content.

  6. #6
    Forum Guru karedog's Avatar
    Join Date
    10-03-2014
    Location
    Indonesia
    MS-Off Ver
    2003
    Posts
    2,971

    Re: VB Code to change date if more then certain entries

    You are welcome Riz, thanks for rep.points.

    As for directly outputing on column A, just change :
    Please Login or Register  to view this content.
    into :
    Please Login or Register  to view this content.
    Regards

  7. #7
    Valued Forum Contributor
    Join Date
    01-18-2007
    Location
    Georgia
    MS-Off Ver
    2010
    Posts
    4,434

    Re: VB Code to change date if more then certain entries

    Hello:

    Thanks again to both of you, Great Work

    R

+ 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: 1
    Last Post: 11-27-2017, 08:50 PM
  2. [SOLVED] Change code so macro activates when entry date is older or equal to current date
    By Big.Moe in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-29-2017, 10:59 PM
  3. [SOLVED] restrict a search to either text entries or date entries when loading dynamic userform
    By nigelog in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-28-2017, 06:06 AM
  4. Formulas or code to find multiple entries and change corresponding cell values
    By prazyna in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-11-2015, 04:59 PM
  5. Need vba code to change date&time stamp as date format dd-mmm-yy in A:A rng
    By breadwinner in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-03-2014, 06:08 AM
  6. Replies: 4
    Last Post: 07-09-2012, 04:15 PM
  7. [SOLVED] Way to have VB code to filter on entries that have cell with today's date?
    By StargateFan in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 05-17-2005, 09:06 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