LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #8   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 are welcome. I did make one more code variation. In this one,
the "Log Out" cell will accept a time entry only if the "Log In" cell has data in it.
The two time columns must be adjacent for this to work.
It may or may not be a better fit 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
ElseIf Not Application.Intersect(Target(1), Me.Columns("D")) Is Nothing Then
If Len(Target(1).Value) = 0 And Len(Target(1)(1, 0).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 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
 
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 01:55 PM.

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"