• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Identify if cell in the range does not equal to number

ThrottleWorks

Excel Ninja
Code:
If OSht.Cells(i, MyCol (SumSht.Range("a1")).Column) <> "" And OSht.Cells(i, MyCol (SumSht.Range("a9")).Column).Value <> not a number Then

OSht.Cells(i, MyCol (SumSht.Range("a9")).Column).clear

End If
Hi,

I am running an if condition in a range. I am facing problem while deciding the value is ‘Not Numeric.


Please see below example for your reference.


If Range A1 value = “Honda” (any text) and Range B1 value = 100 (any number) then do nothing


If Range A1 value = “Honda” (any text) and Range B1 value <> 100 (any number) then take action.


I tried Is Numeric but somehow it’s not working



Can someone please help me regarding how to write this condition
 
Does this give a good example?
Code:
Sub CheckThings()
If IsNumeric(Range("B1").Value) And Not (IsNumeric(Range("A1").Value)) And Range("B1").Value <> "" Then
    MsgBox "do nothing"
Else
    MsgBox "do something"
End If
End Sub
 
Back
Top