|
Sub rmbzsjs()
Sheet1.Select
x1 = 3
Do While Not (IsEmpty(Sheet1.Cells(x1, 1).Value))
je = Sheet1.Cells(x1, 1).Value
j100 = Int(je / 100)
j50 = Int((je - j100 * 100) / 50)
j20 = Int((je - j100 * 100 - j50 * 50) / 20)
j10 = Int((je - j100 * 100 - j50 * 50 - j20 * 20) / 10)
j5 = Int((je - j100 * 100 - j50 * 50 - j20 * 20 - j10 * 10) / 5)
j1 = Int(je - j100 * 100 - j50 * 50 - j20 * 20 - j10 * 10 - j5 * 5)
j05 = Int((je - Int(je)) / 0.5)
j01 = (je - j100 * 100 - j50 * 50 - j20 * 20 - j10 * 10 - j5 * 5 - j1 - j05 * 0.5) * 10
Sheet1.Cells(x1, 2).Value = j100
Sheet1.Cells(x1, 3).Value = j50
Sheet1.Cells(x1, 4).Value = j20
Sheet1.Cells(x1, 5).Value = j10
Sheet1.Cells(x1, 6).Value = j5
Sheet1.Cells(x1, 7).Value = j1
Sheet1.Cells(x1, 8).Value = j05
Sheet1.Cells(x1, 9).Value = j01
x1 = x1 + 1
Loop
End Sub |
|