Enter Time by clicking on a cell

Solved/Closed
jkdurkin Posts 5 Registration date Friday 14 December 2012 Status Member Last seen 14 December 2012 - 14 Dec 2012 à 07:53
totzkie10 Posts 4 Registration date Friday 21 June 2013 Status Member Last seen 9 July 2013 - 21 Jun 2013 à 17:52
Hello,

I need help setting a code in Excel. I am new to VBA but have used Excel for awhile. I would like to set Columns D & E up for time. I want to be able to click on any cell from D4:D2000 and E4:E2000 and the current time will fill automatically.

Any help would be greatly appreciated.

Thanks



Related:

3 responses

rizvisa1 Posts 4478 Registration date Thursday 28 January 2010 Status Contributor Last seen 5 May 2022 766
14 Dec 2012 à 07:57
https://ccm.net/faq/6279-excel-enter-current-time-in-a-cell-by-clicking-it#q=SearchEnter+Time+by+clicking+on+a+cell&cur=2&url=%2F
jkdurkin Posts 5 Registration date Friday 14 December 2012 Status Member Last seen 14 December 2012
14 Dec 2012 à 08:14
Thanks rizvisa1,

I tried this and it works great. My problem is, I need only D & E columns to have the time. I am working on a time sheet that allows employees to enter their start time and end time for each job. If I leave it formated where all cells can be double clicked and the time is entered, I will have a royal mess.


Thanks for your help
jkdurkin Posts 5 Registration date Friday 14 December 2012 Status Member Last seen 14 December 2012
14 Dec 2012 à 08:01
Thanks rizvisa1,

I tried this and it works great. My problem is, I need only D & E columns to have the time. I am working on a time sheet that allows employees to enter their start time and end time for each job.

Thanks for your help
rizvisa1 Posts 4478 Registration date Thursday 28 January 2010 Status Contributor Last seen 5 May 2022 766
14 Dec 2012 à 17:08
In the code you will see this

Set MyRange = Range("F4:F100")

you can change to suit you as
Set MyRange = Range("D:E")
jkdurkin Posts 5 Registration date Friday 14 December 2012 Status Member Last seen 14 December 2012
14 Dec 2012 à 17:53
Thanks, you are amazing!
rizvisa1 Posts 4478 Registration date Thursday 28 January 2010 Status Contributor Last seen 5 May 2022 766
14 Dec 2012 à 19:22
you are quite wecome
totzkie10 Posts 4 Registration date Friday 21 June 2013 Status Member Last seen 9 July 2013
21 Jun 2013 à 17:52
Hi! I'm trying to make a tracker using excel wherein we can calculate the minutes used in each task that we make. I am planning to have the start time under A, end time under B, total mins in C, then I'll have to enter other data on the following columns manually. I would like to create a shortcut or key to be able to enter the time faster. Please help.

Thank you!