Using an OR within an IF MAcros

0

I have the following code:

For i = 1 To j
        If Sheets("Detalle sin TDC vista").Range("H" & i) = "Tarjeta" or Sheets("Detalle sin TDC vista").Range("H" & i) = "test" Then
            Rows(i).EntireRow.Delete
        End If
Next

What I'm doing is reading an Excel column since I have to delete the records that are called Card and Vista, when using the OR it does not work but if I remove the Or and only leave one of the two sentences if it works, I you could say if this is the correct way to use an or within an if

    
asked by ARR 15.06.2018 в 23:32
source

1 answer

0

You've tried with:

For i = 1 To j
        If Sheets("Detalle sin TDC vista").Range("H" & i) = "Tarjeta"  Then
              Rows(i).EntireRow.Delete
        ElseIf Sheets("Detalle sin TDC vista").Range("H" & i) = "test" Then
              Rows(i).EntireRow.Delete
        End If
Next
    
answered by 21.06.2018 в 07:25