Enter Time by clicking on a cell [Solved/Closed]

Report
Posts
5
Registration date
Friday December 14, 2012
Status
Member
Last seen
December 14, 2012
-
Posts
4
Registration date
Friday June 21, 2013
Status
Member
Last seen
July 9, 2013
-
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



3 replies

Posts
4476
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
August 2, 2020
764
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
Posts
5
Registration date
Friday December 14, 2012
Status
Member
Last seen
December 14, 2012

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
Posts
5
Registration date
Friday December 14, 2012
Status
Member
Last seen
December 14, 2012

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
Posts
4476
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
August 2, 2020
764
In the code you will see this

Set MyRange = Range("F4:F100")

you can change to suit you as
Set MyRange = Range("D:E")
Posts
5
Registration date
Friday December 14, 2012
Status
Member
Last seen
December 14, 2012

Thanks, you are amazing!
Posts
4476
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
August 2, 2020
764
you are quite wecome
Posts
4
Registration date
Friday June 21, 2013
Status
Member
Last seen
July 9, 2013

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!

Subscribe To Our Newsletter!

The Best of CCM in Your Inbox

Subscribe To Our Newsletter!