VBA If Question

  • Thread starter Thread starter Matt
  • Start date Start date
M

Matt

I'm using Ron de Bruin's "Delete row if a specific value exist
(VBA)". Can someone help me understand this section of the code:

'We check the values in the A column in this example
With .Cells(Lrow, "A")

If Not IsError(.Value) Then

If .Value = "ron" Then .EntireRow.Delete
'This will delete each row with the Value "ron"
'in Column A, case sensitive.

End If

End With

There are two IF statements but only one End If, why is that? I'm
trying to make it so that it will delete the row if one of multiple
values exist. When I use If-ElseIf, it skips all the ElseIfs and just
recognizes the first If. Can someone help?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top