parscon
02-13-2014, 02:04 AM
I have a VBA code that check column A and if does not find and numeric data it will delete the row , now i need clean only the cell on column A
Thank you
Sub CleanRowifnotnumeric()
'clean a row if it doesn't start with a number
Dim rng As Range
Dim cell As Range
Set rng = Range("A1", Range("A" & ActiveSheet.UsedRange.Rows.Count))
For Each cell In rng
Debug.Print Cells.Rows.Address
If IsNumeric(Left(cell.Value, 1)) = False And _
Left(cell.Value, 1) <> "CH" And _
Left(cell.Value, 1) <> "ZM" And _
Left(cell.Value, 1) <> "ZM" _
Then cell.Rows.Cells.Value.ClearContents
Next cell
End Sub
Thank you
Sub CleanRowifnotnumeric()
'clean a row if it doesn't start with a number
Dim rng As Range
Dim cell As Range
Set rng = Range("A1", Range("A" & ActiveSheet.UsedRange.Rows.Count))
For Each cell In rng
Debug.Print Cells.Rows.Address
If IsNumeric(Left(cell.Value, 1)) = False And _
Left(cell.Value, 1) <> "CH" And _
Left(cell.Value, 1) <> "ZM" And _
Left(cell.Value, 1) <> "ZM" _
Then cell.Rows.Cells.Value.ClearContents
Next cell
End Sub