+ Reply to Thread
Results 1 to 14 of 14

Find today's date and then add 1

  1. #1
    Registered User
    Join Date
    06-17-2013
    Location
    Salt Lake City, UT
    MS-Off Ver
    Excel 2011
    Posts
    26

    Find today's date and then add 1

    A1 =Today()

    A3 Monday June 17
    A4 Tuesday June 18
    A5 Wednesday June 19
    A6 Thursday June 20
    A7 Friday June 21

    If today is Wednesday June 19, I want the macro to add one to cell B5, if its Thursday I want it to add 1 to cell B6, etc... I'm not quite sure how to write this. Any help?

  2. #2
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: Find today's date and then add 1

    I want the macro to add one to cell B5
    What do you mean by 1 cell to B5? what is in B5 and B6 cell? can you please explain this part little more?


    If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>>
    Mark your thread as Solved


    If the suggestion helps you, then Click *below to Add Reputation

  3. #3
    Registered User
    Join Date
    06-17-2013
    Location
    Salt Lake City, UT
    MS-Off Ver
    Excel 2011
    Posts
    26

    Re: Find today's date and then add 1

    Cell B5 is blank. When I run the macro it will add 1. If I run it 4 times the value will be 4, like a counter keeping track of how many times I run the macro.

  4. #4
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: Find today's date and then add 1

    Thanks for the brief and 1 more question how you are getting the data's in the below cells?

    A3 Monday June 17
    A4 Tuesday June 18
    A5 Wednesday June 19
    A6 Thursday June 20
    A7 Friday June 21

    Using any formula's? or any other method which will auto populate these dates in those cells? Or it will be a manual entry?

    Because for writing the code the above input will be much more helpful

  5. #5
    Registered User
    Join Date
    06-17-2013
    Location
    Salt Lake City, UT
    MS-Off Ver
    Excel 2011
    Posts
    26

    Re: Find today's date and then add 1

    I would just manually be entering those dates

  6. #6
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: Find today's date and then add 1

    Try this...

    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    06-17-2013
    Location
    Salt Lake City, UT
    MS-Off Ver
    Excel 2011
    Posts
    26

    Re: Find today's date and then add 1

    Thanks, it isn't working though. It is giving me an error and pointing to this line: nRw = Range("A:A").Find(sDate).Row

  8. #8
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: Find today's date and then add 1

    Oopss... Try this enhanced code

    Please Login or Register  to view this content.

  9. #9
    Registered User
    Join Date
    06-17-2013
    Location
    Salt Lake City, UT
    MS-Off Ver
    Excel 2011
    Posts
    26

    Re: Find today's date and then add 1

    Hmm, It's still giving me a runtime error 91

  10. #10
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: Find today's date and then add 1

    Please attach a sample workbook for better understanding

  11. #11
    Registered User
    Join Date
    06-17-2013
    Location
    Salt Lake City, UT
    MS-Off Ver
    Excel 2011
    Posts
    26

    Re: Find today's date and then add 1

    Here is he attached file

    So I was hoping to click the "IRC" button and have it add a 1 to the correct cell, depending on what the day is. Its just a basic counter that keeps track of how many times I click it.
    Attached Files Attached Files

  12. #12
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: Find today's date and then add 1

    Thanks for the attachment file

    Try this revised code...

    Please Login or Register  to view this content.

  13. #13
    Registered User
    Join Date
    06-17-2013
    Location
    Salt Lake City, UT
    MS-Off Ver
    Excel 2011
    Posts
    26

    Re: Find today's date and then add 1

    Oh wow! Thanks for you help. That's exactly what was I was hoping to do. Now I'll have to dissect it and find out how it works. I appreciate your help.

  14. #14
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: Find today's date and then add 1

    Glad it helps you and thanks for the feedback

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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