|
参与一下。。。
- Sub ykcbf() '//2025.1.15
- With Sheets("Sheet1")
- r = .Cells(Rows.Count, 2).End(xlUp).Row
- .[c3:g9] = ""
- For i = 3 To r
- s = .Cells(i, 2).Value
- Select Case s
- Case Is < 150
- .Cells(i, 3).Value = s
- Case Is < 400
- .Cells(i, 3).Value = 150
- .Cells(i, 4).Value = s - 150
- Case Is < 700
- .Cells(i, 3).Value = 150
- .Cells(i, 4).Value = 250
- .Cells(i, 5).Value = s - 400
- Case Is < 1000
- .Cells(i, 3).Value = 150
- .Cells(i, 4).Value = 250
- .Cells(i, 5).Value = 300
- .Cells(i, 6).Value = s - 700
- Case Else
- .Cells(i, 3).Value = 150
- .Cells(i, 4).Value = 250
- .Cells(i, 5).Value = 300
- .Cells(i, 6).Value = 300
- .Cells(i, 7).Value = s - 1000
- End Select
- Next
- End With
- End Sub
复制代码
|
|