|
Private Sub CommandButton1_Click()
Dim N%, K%, I%
With Sheets("Sheet1")
.UsedRange.Offset(2).Delete
For I = 3 To [N65536].End(3).Row
If Range("C" & I) <> nw Then
N = N + 1: K = 13
.Range("1:2").Copy .Range("A" & N * 2 + 1)
.Range("A" & N * 2 + 2) = Range("A" & I)
.Range("B" & N * 2 + 2) = Range("B" & I)
.Range("C" & N * 2 + 2) = Range("C" & I)
.Range("D" & N * 2 + 2) = Range("D" & I)
.Range("E" & N * 2 + 2) = Range("G" & I)
.Range("F" & N * 2 + 2) = Range("H" & I)
.Range("G" & N * 2 + 2) = Range("I" & I)
.Range("H" & N * 2 + 2) = Range("J" & I)
nw = Range("C" & I)
End If
If Trim(Range("E" & I)) <> "" Then .Range("K" & N * 2 + 2) = .Range("K" & N * 2 + 2) & "," & Range("E" & I)
K = K + 1
Next
.Activate
End With
End Sub
能不能将数据只筛选出黑色字体的E列填到Sheet1的K列
|
|