views:

61

answers:

2

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
tnx, to insert a new blank cell to front of non numeric one
Tom
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
Tip: Integer is too small to be used for a Row counter try using Long to prevent overflow.
Oorang
@Oorang: Good point, thanks. I've updated my answer.
Heinzi
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