lundi 30 juillet 2018

VBA For loop + if statement error

I am trying to create a loop that finds the value of my input box, select the cell that has the matching value of my input box and delete its the entire row. For some reason It seems like my if condition is not working at all.

*Totalrow= my double variable for the total number of rows on my sheet *tenroxcode = my string variable for the inputbox

For i = 1 To totalrows
    If tenroxcode = Range("E" & i).Value Then
        Range("E" & i).Select
        ActiveCell.EntireRow.Delete
    End If
Next

Could someone PLEASE help me?

Aucun commentaire:

Enregistrer un commentaire