gautammalkani
Technical User
Hi All
I want to check a range of values (Range B9:F9) to see if they are empty or not-numeric. I have attached my code from below which shows that it works for just range B9. I tried several variations of the code but couldnt get it working. Please let me know if there is something I am doing wrong
Thanks
Gautam
' Here is the code
Private Sub PUB_Submit_BTN_Click()
' Error check before sending the data to SAP
' It also converts commas, spaces in integers and converts them to a complete number
' Displays error message and sets the erroneous data to NULL before sending the data
Dim response
If IsNumeric(Range("b9").Value) Then
If IsEmpty(Range("b9").Value) Then
response = MsgBox("You need to fill a value in cell A1", vbOKOnly, "Missing mandatory information", "DEMO.HLP", 1000)
Range("b9").Value = ""
Else
UserForm1.Show
End If
Else
response = MsgBox("Please enter numeric value", vbOKOnly, "Error in your message", "DEMO.HLP", 1000)
Range("b9").Value = ""
End If
End Sub
I want to check a range of values (Range B9:F9) to see if they are empty or not-numeric. I have attached my code from below which shows that it works for just range B9. I tried several variations of the code but couldnt get it working. Please let me know if there is something I am doing wrong
Thanks
Gautam
' Here is the code
Private Sub PUB_Submit_BTN_Click()
' Error check before sending the data to SAP
' It also converts commas, spaces in integers and converts them to a complete number
' Displays error message and sets the erroneous data to NULL before sending the data
Dim response
If IsNumeric(Range("b9").Value) Then
If IsEmpty(Range("b9").Value) Then
response = MsgBox("You need to fill a value in cell A1", vbOKOnly, "Missing mandatory information", "DEMO.HLP", 1000)
Range("b9").Value = ""
Else
UserForm1.Show
End If
Else
response = MsgBox("Please enter numeric value", vbOKOnly, "Error in your message", "DEMO.HLP", 1000)
Range("b9").Value = ""
End If
End Sub