i would like to know how to create macro in excel to disallow input of numbers by the user. the user is allow to enter characters except numbers. pls list the steps to guide me through. thank you
i would like to know how to create macro in excel to disallow input of numbers by the user. the user is allow to enter characters except numbers. pls list the steps to guide me through. thank you
Yummy,
This code will prevent the user from entering anything but text on the worksheet and display a message to the user that only text is allowed. Put this code in the Worksheet's Change Event. If you need help with this, contact me either by private message or e-mail me at LeithRoss@aol.com. This code can be modified to allow numbers to be input only in seelcted cells or ranges.
_________________________________________________________________
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
Test = WorksheetFunction.IsNumber(Target.Value)
If Test = True Then
MsgBox "You may only EnterText !", vbExclamation + vbOKOnly
Target.Value = ""
Range(Target.Address).Select
End If
End Sub_________________________________________________________________
Should work fine,
Leith Ross
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks