- ©«¤l
- 12
- ¥DÃD
- 2
- ºëµØ
- 0
- ¿n¤À
- 14
- ÂI¦W
- 0
- §@·~¨t²Î
- Windows 7
- ³nÅ骩¥»
- Office 2013
- ¾\ŪÅv
- 10
- µù¥U®É¶¡
- 2013-11-25
- ³Ì«áµn¿ý
- 2014-1-17
|
¸Õ¸Õ³oÓ- Sub copydata()
- Dim s1 As Long, s2 As Long, s3 As Long, d1 As Long, d2 As Long
- Dim wages As Long, OT As Long
- i = 1
- While Sheets(1).Cells(i, 1) <> "Á~ª÷"
- i = i + 1
- Wend
- wages = i
- While Sheets(1).Cells(i, 1) <> "¥[¯Z"
- i = i + 1
- Wend
- OT = i
- For i = wages To Sheets(1).UsedRange.Rows.Count
- s1 = Left(Sheets(1).Cells(i, 2), 4)
- s2 = Mid(Sheets(1).Cells(i, 2), 6, InStr(1, Sheets(1).Cells(i, 2), "¤ë") - 5 - 1)
- If InStr(1, Sheets(1).Cells(i, 2), "-") <> 0 Then
- s3 = Mid(Sheets(1).Cells(i, 2), InStr(1, Sheets(1).Cells(i, 2), "-") + 1, Len(Sheets(1).Cells(i, 2)) - (InStr(1, Sheets(1).Cells(i, 2), "-") + 1))
- Else
- s3 = 0
- End If
- For j = 2 To Sheets(2).UsedRange.Rows.Count
- d1 = Left(Sheets(2).Cells(j, 1), 4)
- d2 = Mid(Sheets(2).Cells(j, 1), 6, InStr(1, Sheets(2).Cells(j, 1), "¤ë") - 1 - 5)
-
- If d1 * 100 + d2 >= s1 * 100 + s2 Then
- If s3 <> 0 Then
- If d1 * 100 + d2 <= s1 * 100 + s3 Then
- If i >= OT Then
- Sheets(2).Cells(j, 3) = Sheets(1).Cells(i, 3)
- Else
- Sheets(2).Cells(j, 2) = Sheets(1).Cells(i, 3)
- End If
- End If
- Else
- If i >= OT Then
- Sheets(2).Cells(j, 3) = Sheets(1).Cells(i, 3)
- Else
- Sheets(2).Cells(j, 2) = Sheets(1).Cells(i, 3)
- End If
- End If
- End If
- Next j
- Next i
- End Sub
½Æ»s¥N½X |
|