|
Private Sub CommandButton1_Click()
Dim csyx As String
num_row = Cells(25566, 1).End(xlUp).Row
Sheet1.Cells(1, "A").Resize(num_row, 5).Select
Selection.Copy Sheet1.Cells(1, "H").Resize(num_row, 5)
For i = 3 To num_row
If csyx = "" Or Sheet1.Cells(i, "L") <> csyx Then
csyx = Sheet1.Cells(i, "L").Text
csyx_row = i
GoTo skip
End If
If Sheet1.Cells(i, "L") = csyx Then
Sheet1.Cells(csyx_row, "J") = Sheet1.Cells(i, "J")
Sheet1.Cells(csyx_row, "K") = Sheet1.Cells(csyx_row, "K") + Sheet1.Cells(i, "K")
Sheet1.Cells(i, "H").Resize(1, 5).ClearContents
GoTo skip
End If
If Sheet1.Cells(i, "L") <> csyx Then
csyx = ""
End If
skip:
Next i
End Sub |
|