回復 8#av8d
試試看:
Private Sub CommandButton1_Click()
Dim Rng, rngE As Range, row1, i As Integer
Dim sh1, sh3 As Object
' Set sh1 = ThisWorkbook.Sheets("Sheet1")
Set sh3 = ThisWorkbook.Sheets("Sheet3")
end1 = [A65536].End(xlUp).Row
Set rngE = [E2].Resize(end1, 1)
i = 2
sh3.Activate
For Each Rng In rngE
If Rng = "v" Then
Cells(Rng.Row, 1).Resize(1, 4).Copy
sh3.Cells(i, 2).Select
' row1 = [I65536].End(xlUp).Offset(1, 0).Row
' Cells(row1, 9).Resize(1, 4).Select
ActiveSheet.Paste
i = i + 1
End If
Next
End Sub作者: av8d 時間: 2014-3-14 18:03