0
如何使用VBA以編程方式從一個工作表中複製行,然後在移動後刪除它們?我似乎並沒有根據標準刪除所有記錄,我正在尋找。如何從一個工作表中複製行,然後在移動後刪除它們?
Dim lRowCounter as Long, lTotalRows as Long,sCommPerUnit as String,lExceptionRowCounter as Long
lTotalRows = 10
For lRowCounter = 1 To lTotalRows
'If Row has no mapping, move it to Exceptions Report
sCommPerUnit = Trim(rRange.Offset(lRowCounter, 2))
If (sCommPerUnit = "SOMETHING") Then
lExceptionRowCounter = lExceptionRowCounter + 1
'Move row to Exception Report Worksheet
rExceptionRange.Offset(lExceptionRowCounter, 1) = Trim(rRange.Offset(lRowCounter, Output_Order))
'Delete Row from Report
rRange.Offset(lRowCounter, 1).EntireRow.Delete xlShiftUp
End If
Next
問候
科喬
感謝您回答這個問題,方便的提示。 – Kojof 2010-03-06 13:41:08