Dears,
Iam trying to create a Data validation in VBA. Imagine I have a range of cells A1:A10 and I want a MsgBox to pop up if user enter text in one of the cells.
Iam trying below but does not work.
Sub test()
Dim rcell As Range
Set rcell = Range("A1:A10")
If IsEmpty(rcell) Or IsNumeric(rcell.Value) Then
Else
MsgBox "Error"
End If
End Sub
In the sheet module put the code like this:
When you type or paste text into any of the cells
A1:A10an error message appears.