Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 390
Default macro to automatically insert static time in a cell

I'm creating a sign-in worksheet for "retired volunteers" in a non-profit
organization. The sign-in sheet is to keep up with the time worked by
volunteers. As many are computer illiterate, I need the time to enter
automatically the easiest way when they log in so as to eliminate typing
errors. Maybe a macro? Can anyone help? Most have poor computer skills.
Thanks in advance.
--
Bill HH
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 4
Default macro to automatically insert static time in a cell

Bill,

I created this to allow users to enter the current date and time in a sheet.
I gave it a shortcut of Ctrl+d to run. (D for date for my users with poor
computer skills.)

Sub Current_Date_Time()
'
'
Application.SendKeys ("^; ^+;{RIGHT}")

End Sub

Ctrl+semicolon enters date then a space and Ctrl+Shift+semicolon enters
current time and the active cell will shift to the right.

Bill wrote:
I'm creating a sign-in worksheet for "retired volunteers" in a non-profit
organization. The sign-in sheet is to keep up with the time worked by
volunteers. As many are computer illiterate, I need the time to enter
automatically the easiest way when they log in so as to eliminate typing
errors. Maybe a macro? Can anyone help? Most have poor computer skills.
Thanks in advance.


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,549
Default macro to automatically insert static time in a cell

You could tell them to hold down the Ctrl key and the Shift key and press the
semi-colon key. But somehow I don't think that will fly.
Or...
You could tell them to click the cell twice in the "Started At" column.

To make that happen...
Right-click the sheet tab, select View Code and paste the following code into
the big window on the right.
'--Code Starts Below

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
If Not Application.Intersect(Target(1), Me.Columns("C")) Is Nothing Then
Target(1).Value = Time
End If
End Sub

'----Code Ends Above
In the second line of the code change "C" to the appropriate column letter
--
Jim Cone
Portland, Oregon USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)

..


"Bill"
wrote in message
I'm creating a sign-in worksheet for "retired volunteers" in a non-profit
organization. The sign-in sheet is to keep up with the time worked by
volunteers. As many are computer illiterate, I need the time to enter
automatically the easiest way when they log in so as to eliminate typing
errors. Maybe a macro? Can anyone help? Most have poor computer skills.
Thanks in advance.
--
Bill HH
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,549
Default macro to automatically insert static time in a cell


This variation might work better for you...
'--
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
If Not Application.Intersect(Target(1), Me.Columns("C")) Is Nothing Then
If Len(Target(1).Value) = 0 Then
Target(1).Value = Time
Cancel = True
End If
End If
End Sub
'--
Jim Cone
Portland, Oregon USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 390
Default macro to automatically insert static time in a cell

Thanks Jim. That will work. Except I have one other question. Is there a way
to make that work for the next column as well? The volunteers sign and then
sign out and the total time is recorded for the organizational records.
Thanks again.
Bill
--
Bill HH


"Jim Cone" wrote:


This variation might work better for you...
'--
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
If Not Application.Intersect(Target(1), Me.Columns("C")) Is Nothing Then
If Len(Target(1).Value) = 0 Then
Target(1).Value = Time
Cancel = True
End If
End If
End Sub
'--
Jim Cone
Portland, Oregon USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)




  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,549
Default macro to automatically insert static time in a cell


Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
If Not Application.Intersect(Target(1), Me.Columns("C")) Is Nothing Then
If Len(Target(1).Value) = 0 Then
Target(1).Value = Time
Cancel = True
End If
ElseIf Not Application.Intersect(Target(1), Me.Columns("D")) Is Nothing Then
If Len(Target(1).Value) = 0 Then
Target(1).Value = Time
Cancel = True
End If
End If
End Sub
--
Jim Cone
Portland, Oregon USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)



"Bill"
wrote in message
Thanks Jim. That will work. Except I have one other question. Is there a way
to make that work for the next column as well? The volunteers sign and then
sign out and the total time is recorded for the organizational records.
Thanks again.
Bill
--
Bill HH
  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 390
Default macro to automatically insert static time in a cell

Thanks again Jim. By the way, I decided to try just listing several columns
and only the time-in, time-out columns were empty. That seemed to work also
by inserting the time with just a double-click. This is greatly appreciated
and will really help a non-profit organization helping needy girls.
--
Bill HH


"Jim Cone" wrote:


Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
If Not Application.Intersect(Target(1), Me.Columns("C")) Is Nothing Then
If Len(Target(1).Value) = 0 Then
Target(1).Value = Time
Cancel = True
End If
ElseIf Not Application.Intersect(Target(1), Me.Columns("D")) Is Nothing Then
If Len(Target(1).Value) = 0 Then
Target(1).Value = Time
Cancel = True
End If
End If
End Sub
--
Jim Cone
Portland, Oregon USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)



"Bill"
wrote in message
Thanks Jim. That will work. Except I have one other question. Is there a way
to make that work for the next column as well? The volunteers sign and then
sign out and the total time is recorded for the organizational records.
Thanks again.
Bill
--
Bill HH

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel: How to insert current time (static) to the nearest second? gwm Excel Worksheet Functions 14 July 13th 07 12:26 AM
Insert static time Maverick Excel Worksheet Functions 5 July 27th 06 07:43 PM
insert colons in time automatically when input to cell Mike Excel Worksheet Functions 1 January 13th 06 01:26 AM
how do I insert the current time (static) and date in a cell? DF Excel Discussion (Misc queries) 5 October 28th 05 05:54 PM
automatically insert system time in a cell PM Excel Discussion (Misc queries) 2 December 30th 04 04:56 PM


All times are GMT +1. The time now is 09:18 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"