ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Delete row depending on size of Characters in cell (https://www.excelbanter.com/excel-programming/318611-delete-row-depending-size-characters-cell.html)

CarlJ

Delete row depending on size of Characters in cell
 
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

Sharad

Delete row depending on size of Characters in cell
 
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




*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

CarlJ

Delete row depending on size of Characters in cell
 
Thank you Sharad
you really helped me
Carl

"Sharad" wrote:

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




*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!



All times are GMT +1. The time now is 02:55 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com