Validate a cell Using ISNUMBER Function

    Here i am using below mentioned functionalites to ensure whether the entered value in a cell consists of NUMBER or not

     

  • ISNUMBER Function
  • CHANGE - Worksheet Event
  •  

    Private Sub Worksheet_Change(ByVal Target As Range)
    Application.EnableEvents = False
    Dim rng As Range
    Set rng = Range("B2:H14")

    If Not Intersect(Target, rng) Is Nothing Then
    If Not Application.WorksheetFunction.IsNumber(Target.Value) Then
    MsgBox "This is not Number. Please enter valid Data"
    Cells(Target.Row, Target.Column).Value = "Enter Valid Data"
    End If
    End If

    Application.EnableEvents = True
    End Sub

     

    Download The Workbook