Nicolaf
04-16-2015, 06:27 AM
Hi,
I have a macro that deletes a row if two cells have different value (cells in column A and G).
I would now like to add two more conditions in order to proceed with deleting row:
1. the cell in column G is numeric (as opposed to text).
2. the cell in column B does not contain word "Final"
Dim wFinalResult As Worksheet
ActiveWorkbook.Sheets("FinalResult").Activate
Set wFinalResult = ActiveSheet
Dim N As Long, i As Long
N = Cells(Rows.Count, "A").End(xlUp).Row
For i = N To 2 Step -1
If Cells(i, "A").Value <> Cells(i, "G").Value Then
Cells(i, "A").EntireRow.Delete
End If
Next i
End Sub
How would I do that?
Nic
:confused: :confused4
I have a macro that deletes a row if two cells have different value (cells in column A and G).
I would now like to add two more conditions in order to proceed with deleting row:
1. the cell in column G is numeric (as opposed to text).
2. the cell in column B does not contain word "Final"
Dim wFinalResult As Worksheet
ActiveWorkbook.Sheets("FinalResult").Activate
Set wFinalResult = ActiveSheet
Dim N As Long, i As Long
N = Cells(Rows.Count, "A").End(xlUp).Row
For i = N To 2 Step -1
If Cells(i, "A").Value <> Cells(i, "G").Value Then
Cells(i, "A").EntireRow.Delete
End If
Next i
End Sub
How would I do that?
Nic
:confused: :confused4