Row Delition

  • Thread starter Thread starter Todd Huttenstine
  • Start date Start date
T

Todd Huttenstine

Hey guys

here is the code I got so far.
I am trying to delete the entire row but when I run my
code I am getting the error "Object Required" What am I
doing wrong. I want the entire row to be deleted if the
code finds the value BSC in column T. Also some of these
cells have the value "BSC " (With multiple spaces).
How do I get the code to recognize any cell with the value
BSC as well as spaces aftwer the BSC?


Thank you


Private Sub CommandButton1_Click()
Dim cell As Range
Dim cola As Range
Set cola = Sheets("RDFMTD").Range("T2:T100")
For Each cell In cola
If cell.Value = "BSC" Then
'cell.Select
EntireRow.Delete
End If
Next
End Sub
 

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