0
你好我試圖循環一個if-else所有列。但它返回1004錯誤不斷對於列的每個循環
Private Sub CommandButton1_Click()
Sheets("InputRAW").Columns(2).Copy Destination:=Sheets("OutputALL").Columns(1)
With ActiveSheet
Lastrow = .Cells(.Rows.Count, "A").End(xlUp).Row
End With
Dim rRng As Range
Set rRng = Range("A1:A" & Lastrow)
For Each cell In rRng.Cells
If IsEmpty(cell) Then
Worksheets("InputRAW").Range("C" & cell).Copy Destination:=Worksheets("OutputALL").Range("B" & cell)
Else
Worksheets("InputRAW").Range("A" & cell).Copy Destination:=Worksheets("OutputALL").Range("B" & cell)
End If
Next
End Sub
'工作表( 「InputRAW」),範圍( 「C」 和cell.ROW ).Copy'(同目的地) – Jeeped