dear all 大大 -
1. 如圖一程式會將符合條件之sheet1資料傳至 sheet2之 A2 A3 A4 ..............
2. 需求為 將符合條件之sheet1資料傳至 sheet2之 A2 A6 A10 ..............跳4列放置資料
2.1請問程式如何修改.煩不吝賜教 thanks*10000
圖一
Sub robert()
Sheet2.[A1:G65536].ClearContents
X = Sheet1.[A65536].End(xlUp).Row
Y = Sheet2.[A65536].End(xlUp).Row
For M = 5 To X
If Not (Sheet1.Cells(M, 5) = "" Or Sheet1.Cells(M, 5) = " ") Then
Sheet2.Cells(Y + 1, 1) = Sheet1.Cells(M, 1)
Y = Y + 1
End If
Next
End Sub作者: n7822123 時間: 2018-10-3 00:12
Sub robert()
Sheet2.[A1:G65536].ClearContents
X = Sheet1.[A65536].End(xlUp).Row
Y = Sheet2.[A65536].End(xlUp).Row
For M = 5 To X
If Not (Sheet1.Cells(M, 5) = "" Or Sheet1.Cells(M, 5) = " ") Then
Sheet2.Cells(Y + 1, 1) = Sheet1.Cells(M, 1)
Y = Y + 4 '跳四列
End If
Next
End Sub