FD: ActiveCell.Offset(1, 0).Select If ActiveCell <> "" Then If ActiveCell.Offset(1, 0) <> ActiveCell Then ActiveCell.Offset(0, 28) = "" Else ActiveCell.Offset(0, 28) = ActiveCell.Offset(1, 3) End If If ActiveCell.Offset(0, 7) <> "" Then MRT = ActiveCell.Offset(0, 4) * ActiveCell.Offset(0, 7) + ActiveCell.Offset(0, 5) NRT = 0 RT: If ActiveCell <> ActiveCell.Offset(1, 0) Then ActiveCell.Offset(-NRT, 0).Select Else ActiveCell.Offset(1, 0).Select NRT = NRT + 1 MRT = MRT + ActiveCell.Offset(0, 4) * ActiveCell.Offset(0, 7) + ActiveCell.Offset(0, 5) GoTo RT End If ActiveCell.Offset(0, 26) = MRT End If AFT = 0 AY = 0 NFT = 0 If ActiveCell.Offset(0, 7) <> "" Then If ActiveCell.Offset(0, 9) <> "" Then If Mid(ActiveCell.Offset(0, 3), 2, 1) = "E" Then AY = AY + ActiveCell.Offset(0, 12) / 60 Else AFT = AFT + ActiveCell.Offset(0, 12) * 1 End If FT: If ActiveCell <> ActiveCell.Offset(-1, 0) Then ActiveCell.Offset(NFT, 0).Select Else ActiveCell.Offset(-1, 0).Select NFT = NFT + 1 If Mid(ActiveCell.Offset(0, 3), 2, 1) = "E" Then AY = AY + ActiveCell.Offset(0, 12) / 60 Else AFT = AFT + ActiveCell.Offset(0, 12) * 1 End If GoTo FT End If End If ActiveCell.Offset(0, 25) = AFT ActiveCell.Offset(0, 27) = AFT * 78.39 / 60 + AY End If Else End End If If Mid(ActiveCell.Offset(0, 3), 2, 1) = "E" Then If ActiveCell.Offset(0, 10) = "W" Or ActiveCell.Offset(0, 10) = "M" Or ActiveCell.Offset(0, 10) = "S" Then WCID = "0" W2C = "0" MO = "0" ITE = "0" LSD = "0" STQ = "0" RT = "0" N = "0" NXW = "0" NRT = "0" MOS = "0" SCM = "0" MO = ActiveCell WCID = Mid(ActiveCell.Offset(0, 3), 1, 5) W2C = Mid(ActiveCell.Offset(0, 3), 1, 2) MA = ActiveCell.Offset(0, -1) ITE = ActiveCell.Offset(0, 1) LSD = ActiveCell.Offset(0, 18) STQ = ActiveCell.Offset(0, 8) RT = ActiveCell.Offset(0, 11) NXW = ActiveCell.Offset(0, 28) NRT = ActiveCell.Offset(0, 26) MOS = ActiveCell.Offset(0, 10) SCM = ActiveCell.Offset(0, 24) Sheets(WCID).Select ActiveCell.Offset(1, 0).Select ActiveCell = WCID ActiveCell.Offset(0, 1) = MA ActiveCell.Offset(0, 2) = MO ActiveCell.Offset(0, 3) = ITE ActiveCell.Offset(0, 4) = LSD ActiveCell.Offset(0, 5) = STQ ActiveCell.Offset(0, 6) = RT ActiveCell.Offset(0, 7) = NXW ActiveCell.Offset(0, 8) = NRT ActiveCell.Offset(0, 9) = MOS ActiveCell.Offset(0, 10) = SCM End If End If Sheets("SELMO").Select GoTo FD End Sub
|