ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   delete values in cells (https://www.excelbanter.com/excel-programming/322015-delete-values-cells.html)

JH

delete values in cells
 
Hello,

I'd like to remove values in cells (not cells) in column A that don't
contain a 10digit number.

thanks for any suggestions

Jan



Markus Scheible[_2_]

delete values in cells
 
Hi Jan,


I'd like to remove values in cells (not cells) in column

A that don't
contain a 10digit number.



try

For Each cell In Range("whatever")

If (cell.Value Mod 1000000000 = 0) Then
cell.Value = ""
End If

Next cell


Best

Markus

Ajtb

delete values in cells
 
JH wrote:
Hello,

I'd like to remove values in cells (not cells) in column A that don't
contain a 10digit number.

thanks for any suggestions

Jan


Hi Jan

This is simple way to do it.


Sub clearcol()
For i = 1 To 100 ' 100 is the no. of rows to check, could be more
If Len(Cells(i, 1)) < 10 Then Cells(i, 1) = ""
Next i
End Sub


HTH

Andrew Bourke

Bernd Plumhoff

delete values in cells
 
Maybe Cells(i, 1).ClearContents?

Regards,
Bernd

JH

delete values in cells
 
Thanks everybody
Jan


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

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