How to check if a specific Column has Integer on each cell, and if it contains a string, Insert a blank cell to row in question.
+2
A:
Untested:
Dim row As Long
Dim col As Long
col = 4 ' Whatever column you want to check
For row = 1 To 100 ' How many rows you want to check
If Not IsNumeric(Cells(row, col).Value) Then
' Do whatever you want to do in this case
End If
Next row
If you clarify what you mean by "Insert a blank cell to row in question", I will try to update my solution.
Heinzi
2009-12-10 13:59:51
tnx, to insert a new blank cell to front of non numeric one
Tom
2009-12-10 14:27:36
So you want to move the non-numeric cell one position to the right and insert a blank cell in its place? Or just clear the cell to the left of the non-numeric one?
Heinzi
2009-12-10 14:35:40
Tip: Integer is too small to be used for a Row counter try using Long to prevent overflow.
Oorang
2009-12-11 13:12:53
@Oorang: Good point, thanks. I've updated my answer.
Heinzi
2009-12-11 13:43:59
A:
You can check even check with a forumla that the column contains no none-numbers only
=COUNTBLANK(AAA:AAA)-COUNTBLANK(B:B)=COUNT(B:B)
where I assume that column AAA:AAA is empty.
Adrian
2009-12-10 14:07:23