Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
widemonk
 
Posts: n/a
Default Regular Time and Over Time


Try this. It may not be the most effecient use of system resources but
it works.

Unfortunately, it fires on EVERY cell that has a number greater than 8,
not just the regular hours.


Code:
--------------------
Public oldcell As String
---------------------
Private Sub Worksheet_Activate()
oldcell = ActiveCell.Address
End Sub
---------------------
Private Sub Worksheet_Change(ByVal Target As Range)

If Range(oldcell).Value 8 Then

Range(oldcell).Select
temphrs = ActiveCell - 8
ActiveCell.Value = 8
ActiveCell.Offset(0, 1) = ActiveCell.Offset(0, 1) + temphrs
End If
oldcell = ActiveCell.Address


End Sub
---------------------
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
oldcell = ActiveCell.Address

End Sub
--------------------


--
widemonk


------------------------------------------------------------------------
widemonk's Profile: http://www.excelforum.com/member.php...o&userid=20402
View this thread: http://www.excelforum.com/showthread...hreadid=487644

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



All times are GMT +1. The time now is 02:34 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"