Enter Time by clicking on a cell

Solved/Closed
jkdurkin Posts 5 Registration date Friday December 14, 2012 Status Member Last seen December 14, 2012 - Dec 14, 2012 at 07:53 AM
totzkie10 Posts 4 Registration date Friday June 21, 2013 Status Member Last seen July 9, 2013 - Jun 21, 2013 at 05:52 PM
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 January 28, 2010 Status Contributor Last seen May 5, 2022 766
Dec 14, 2012 at 07:57 AM
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
0
jkdurkin Posts 5 Registration date Friday December 14, 2012 Status Member Last seen December 14, 2012
Dec 14, 2012 at 08:14 AM
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
0
jkdurkin Posts 5 Registration date Friday December 14, 2012 Status Member Last seen December 14, 2012
Dec 14, 2012 at 08:01 AM
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
0
rizvisa1 Posts 4478 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 766
Dec 14, 2012 at 05:08 PM
In the code you will see this

Set MyRange = Range("F4:F100")

you can change to suit you as
Set MyRange = Range("D:E")
0
jkdurkin Posts 5 Registration date Friday December 14, 2012 Status Member Last seen December 14, 2012
Dec 14, 2012 at 05:53 PM
Thanks, you are amazing!
0
rizvisa1 Posts 4478 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 766
Dec 14, 2012 at 07:22 PM
you are quite wecome
0
totzkie10 Posts 4 Registration date Friday June 21, 2013 Status Member Last seen July 9, 2013
Jun 21, 2013 at 05:52 PM
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!
0