hi,
How do i copy rows from one worksheet programatically using VBA and then delete them after it has moved? I don't seem to be deleting all records based on the criteria, i'm searching for.
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
regards
Kojo