+ Reply to Thread
Results 1 to 14 of 14

Command button to populate todays date and time in next free row

  1. #1
    Forum Contributor
    Join Date
    02-19-2013
    Location
    UK
    MS-Off Ver
    Excel 2019
    Posts
    677

    Exclamation Command button to populate todays date and time in next free row

    Hi all,

    I am using this code to populate todays date and current time in column 1 i.e. A

    But I want it to populate the same in next free row. Currently it only populates in A1

    Any help please???
    Regards

    Please Login or Register  to view this content.

  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: Command button to populate todays date and time in next free row

    Try like this...

    Please Login or Register  to view this content.


    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
    Valued Forum Contributor john55's Avatar
    Join Date
    10-23-2010
    Location
    Europe
    MS-Off Ver
    Excel for Microsoft 365
    Posts
    2,028

    Re: Command button to populate todays date and time in next free row

    try
    Please Login or Register  to view this content.
    Last edited by john55; 06-11-2013 at 04:02 AM. Reason: sorry sixthsense....need refresh the page more often
    Regards, John55
    If you have issues with Code I've provided, I appreciate your feedback.
    In the event Code provided resolves your issue, please mark your Thread as SOLVED.
    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

    ...enjoy -funny parrots-

  4. #4
    Forum Contributor
    Join Date
    02-19-2013
    Location
    UK
    MS-Off Ver
    Excel 2019
    Posts
    677

    Re: Command button to populate todays date and time in next free row

    Hi Sixthsense and John,

    It works like magic. I have clicked * for both to express my gratitude.

    I have similar issue in column 'P' in the same sheet.
    I have provided the similar click button , but it populates date and time in the first available free row.
    But now I want to modify code to populate date and time NOW=() in the cell in column P which is highlighted with mouse.
    Is it possible?
    Regards

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

    Re: Command button to populate todays date and time in next free row

    Do right click on sheet tab and select view code and paste the below code

    Please Login or Register  to view this content.
    Return to excel and do double click on any of the cell of Column P and check

  6. #6
    Forum Contributor
    Join Date
    02-19-2013
    Location
    UK
    MS-Off Ver
    Excel 2019
    Posts
    677

    Re: Command button to populate todays date and time in next free row

    Hi Sixthsense,

    Mate it works like a magic. Thanks. i have clicked * again for you.

    Before I close this one just a last question.

    I use formula to check difference between two dates.
    Please Login or Register  to view this content.
    However it does not calculate time difference.
    Do you have any suggestion how can i do it so that A-P will indicate e.g. Days..... Hours : Mins 00:00.

    many thanks my friend

    Regards

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

    Re: Command button to populate todays date and time in next free row

    Try this...

    Formula: copy to clipboard
    Please Login or Register  to view this content.

  8. #8
    Forum Contributor
    Join Date
    02-19-2013
    Location
    UK
    MS-Off Ver
    Excel 2019
    Posts
    677

    Re: Command button to populate todays date and time in next free row

    Hi Mate,
    Perfect solution.
    Great work.
    Thanks very much. Apology for a delayed reply as I had to go for work.
    Thanks again
    regards

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

    Re: Command button to populate todays date and time in next free row

    Glad it helps you and thanks for the feedback again

  10. #10
    Forum Contributor
    Join Date
    02-19-2013
    Location
    UK
    MS-Off Ver
    Excel 2019
    Posts
    677

    Re: Command button to populate todays date and time in next free row

    Hi again,
    Apology to reopen the thread.
    Ran into slight issue.

    It stopped doing its work. Now it does not subtract time and the days calculation is not as expected.
    E.G.
    Please Login or Register  to view this content.
    Something is missing
    Regards

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

    Re: Command button to populate todays date and time in next free row

    Surely it will work

    Please check once again or just post a sample file with formula and your date for fixing the issue

  12. #12
    Forum Contributor
    Join Date
    02-19-2013
    Location
    UK
    MS-Off Ver
    Excel 2019
    Posts
    677

    Exclamation Re: Command button to populate todays date and time in next free row

    Hi Mate,
    I have attached the file.
    Thanks again
    Regards
    Attached Files Attached Files

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

    Re: Command button to populate todays date and time in next free row

    Thanks for the attachment file

    Try this...
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  14. #14
    Forum Contributor
    Join Date
    02-19-2013
    Location
    UK
    MS-Off Ver
    Excel 2019
    Posts
    677

    Re: Command button to populate todays date and time in next free row

    Hi,
    Now it is is a perfect as ever.
    But is only calculates hours . Min are still an issue. So I modified your formula as below and now it works perfectly without any fault.
    =IF(OR(A2="",P2=""),"","["&DATEDIF(MIN(A2:P2),MAX(A2:P2),"D")&" Days] "&TEXT(MOD(P2-A2,1),"HH:MM:SS"))

    Great help.
    I have clicked *
    Many thanks.
    I have closed the thread.
    Regards

+ 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