Macro [Closed]

Report
-
 cool -
Hello,

I have a excel sheet. In that almost 500 datas exists. now i wanted to compare 2 conditions. If "C:C" column
is "4" and "F:F" is "6", then it has to delete entire row without blank row.

Eg: A B C D E F
1 2 4 4 5 6
2 2 2 2 2 2
3 4 4 0 0 6

In this example it has to delete row 1 and 3.

Please help me to solve.

1 reply

Posts
1862
Registration date
Sunday June 14, 2009
Status
Contributor
Last seen
July 30, 2015
800
use this macro

Sub test()
Dim j As Integer, k As Integer
j = Range("A1").End(xlDown).Row
'j is the last row
For k = j To 1 Step -1
If Cells(k, "c") = 4 And Cells(k, "f") = 6 Then
Cells(k, "c").EntireRow.Delete
End If
Next k
End Sub
Excellent Code sir, Thank You very much.

Subscribe To Our Newsletter!

The Best of CCM in Your Inbox

Subscribe To Our Newsletter!