任何人都可以解釋我如何評估我的行e作爲一個數組,而不是在個人(行)級別?這是提高性能的最佳方式嗎?我如何評估行數據爲一個數組?
Dim x As Integer, i As Integer, y As Long
Set wsCountry = Sheets("Country Data")
Set wsInstructions = Sheets("Instructions")
LastRow = wsCountry.Range("E" & Rows.Count).End(xlUp).Row
For x = 9 To 9
For i = 9 To LastRow
If wsCountry.Range("E" & i) <> wsInstructions.Range("C" & x) Then
wsCountry.Range("A" & i & ":P" & i).ClearContents
End If
Next i
'Delete Blanks
For y = Cells(Rows.Count, 3).End(xlUp).Row To 1 Step -1
If Cells(y, 3) = "" Then
Rows(y).Delete
End If
Next y
'Save workbook AS to FILE
Next x
您可以通過使用過濾器並刪除一次傳遞中的空白行來擺脫一些循環。它是否像你以後那樣調整? – sous2817
在wsCountry表是列A到P整行?另外,您想要刪除表格上的空白行嗎? –