Delete row depending on size of Characters in cell

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello everyone ,

I would like to delete an entire row if a cell on the same row has more
then x amount of characters. I would need this to loop down the entire
spreedsheet. Is this possible ?
Hint: Normally (10 out of 10) the cell its looking for will in the first col

Example: If cell A:109 has more then 40 characters delete row 109

Thank you in advance,
Carl
 
Sub delRows()
For Each c In Worksheets("Sheet1").UsedRange.Cells
If Len(c.Value) > 10 Then
c.EntireRow.Delete
End If
Next c
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