Hello
I have an excel sheet, Column “C” has numbers in it also column “F” has numbers
I want to write a VBA code that will access the sheet and will delete every row that has the value of zero in C and the value of 20 in F in the same row
This is what I did!!!!
Dim Sub zero()
Dim i As Integer
Dim Rng As Range
For i = Cells(Rows.Count, "C".End(xlUp).Row To 1 Step –1
If Cells(i, "C".Value = "0" And Cells(i, "F".Value = "20" Then
Cells(i).EntireRow.delete
End If
'Debug.Print (i)
'Debug.Print Cells(i, "C"
'Debug.Print Cells(i, "F"
Next i
Please advice
Thank you
I have an excel sheet, Column “C” has numbers in it also column “F” has numbers
I want to write a VBA code that will access the sheet and will delete every row that has the value of zero in C and the value of 20 in F in the same row
This is what I did!!!!
Dim Sub zero()
Dim i As Integer
Dim Rng As Range
For i = Cells(Rows.Count, "C".End(xlUp).Row To 1 Step –1
If Cells(i, "C".Value = "0" And Cells(i, "F".Value = "20" Then
Cells(i).EntireRow.delete
End If
'Debug.Print (i)
'Debug.Print Cells(i, "C"
'Debug.Print Cells(i, "F"
Next i
Please advice
Thank you