Hi Nelson,
I hope I have the correct Files and understand the Logic: I see with the last Files you sent that:
Two things are happening,
___ Totals are made and pasted out
And
___ Normal Hrs ( Column I ) and Overtime Hrs ( Column J ) are to be changed
So I this is what I understand is the requirement and have done:
Rem 1) The code is set to work on the Active Workbook. That is the one you “looking at”. ( Any Worksheet can be selected )
Rem 2) Total No, of days is simply taken as a constant of 30. (Const TDays As Long = 30)
'3b)
_ Date ( Column E ) and Total hrs ( Column H ) are required to use in calculations
_ Normal Hrs ( Column I ) are needed as they must be set to zero for Holy ?? Holidays ?? Friday ??
_ Overtime ( Column J ) is needed as it will be changed and then used in calculations.
'3d) We need to check for a Holy?? Holiday?? Friday??
___If so Then
____ Total Hrs ( Column H ) are added to Overtime Hrs ( Column J ) according to the following rules:
____ (i) If Total Hrs are less than or equal to 9 , Then all Total Hrs are Given To to Overtime Hrs
____ (ii) Else If Total Hrs are greater than 9 , Then ( Total Hrs – 1 ) are Given To to Overtime Hrs
____ (iii) Normal Hrs ( Column I ) are then Emptyed.
_3e)
_ As in all my codes, Normal Overtime is simply calculated from summing hours in column J only If there are Overtime hours in column J And there are Normal hours are in column I.
( The total number will be entered into cell G34 )
_ As in all my codes, Holiday Overtime is simply calculated from summing hours in column J only If there are Overtime hours in column J And there are no Normal hours are in column I.
( The total number will entered into cell J34 )
_3f)
The total number Normal Overtime entered into cell G34
The total number Holiday Overtime entered into cell G34
The value of 30 for Total days is simply added to cell C34
_ 3g Normal Hrs ( Column I ) and Overtime Hrs ( Column J ) are changed
_...
_._______________________________
'_- ExPlanations are given in code ' Comments, ( especially for snb ; ) )
Code is here: ( Post #19 )
http://www.excelfox.com/forum/showth...0066#post10066
http://www.excelfox.com/forum/showth...age2#post10066
Typical Results for one Worksheet are given in next 2 Posts
Alan
Bookmarks