0
我是新手,不知道爲什麼我的工作表沒有複製到新工作表中?我在我的VBA中找不到這個錯誤。爲什麼我的VBA excel表單不能複製?
Private Sub Adminminreport_Click()
Application.ScreenUpdating = False
Dim i&, LR&, count&
LR = Worksheets("Parts").Range("J" & Rows.count).End(xlUp).Row
Set newWS = Worksheets.Add
Worksheets("Parts").Range(Worksheets("Parts").Cells(1, 1), Worksheets("Parts").Cells(1, 13)).Copy newWS.Range("A1")
count = 2
For i = 2 To LR
If Range("J" & i).Value < Range("L" & i).Value Then
Worksheets("Parts").Range(Worksheets("Parts").Cells(i, 1), Worksheets("Parts").Cells(i, 13)).Copy newWS.Range("A" & count)
count = count + 1
End If
Next i
Application.ScreenUpdating = True
Unload Me
newWS.Activate
End Sub
我假設它與'for'循環或'IF範圍'語句有關。 – TheRealDK