Private Sub CommandButton1_Click()
Dim WRK1(100), WRK2(100), WRK3(100)
For I = 1 To 100: WRK1(I) = "": Next I
Worksheets("MAR").Activate
'********DEBUG SETUPOFWORKSHEET********************
N = 1001
For I = 3 To 6
ActiveSheet.Cells(I, 1) = N
ActiveSheet.Cells(I, 2) = "TP"
N = N + 1
Next I
ActiveSheet.Cells(3, 3) = "@"
ActiveSheet.Cells(4, 3) = 5
ActiveSheet.Cells(5, 3) = "@"
ActiveSheet.Cells(6, 3) = 10
'********END OF DEBUG SETUP****************************
'***************************************************************************************
' DELETE ROWS THAT HAVE A "@" IN COL 3
'***************************************************************************************
I = 1
For Row = 3 To 6
If ActiveSheet.Cells(Row, 3) = "@" Then
Rows(Row).Select
Selection.Delete SHIFT:=xlUp
Row = Row - 1
Else
If ActiveSheet.Cells(Row, 1) = "" Then Exit For 'END OF LIST
End If
Next Row
Row = 3
For I = 1 To 4
WRK1(I) = ActiveSheet.Cells(Row, 1).Value 'SAVE NUMBERS
Next I
'***************************************************************************************
'DELETE ROWS THAT HAVE THE SAME NUMBER
'***************************************************************************************
Worksheets("APR_RE").Activate
I = 1
For Row = 3 To 6
N = ActiveSheet.Cells(Row, 1).Value
If N = WRK1(I) Then
Rows(Row).Select 'this is where i get the failure
Selection.Delete SHIFT:=xlUp
Row = Row - 1
I = I + 1
End If
Next Row
end sub
'*******************below is what is the apr_re worksheet*
1001 TP 1 @
1002 TP 2 @
1003 TP 3 @
1004 TP 4 @