View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Nicole D. Nicole D. is offline
external usenet poster
 
Posts: 5
Default Restrict user entry to numeric values only

I have Active X control textboxes embeded in a spreadsheet. I created an if
then statement to check if the value is numeric. If the value is numeric
then I use it in a calculation if not the user is prompted by a text box
telling them to only enter numeric values. However, I can not figure out how
to write a condition that "checks" if the value includes alphabetic
characters. This is what I have so far

Dim Prompt As String
If txtQPAuto.Value is <condition?? then
txtQPAuto.Value =
Application.WorksheetFunction.Round(txtQPAuto.Valu e, 0)
txtTQP.Value = txtQPAuto.Value + txtQPWC.Value + txtQPGL.Value +
txtQPProp.Value + txtQPUmb.Value
Else:
Prompt = MsgBox("Please enter a whole number value.", vbOKOnly,
"Total Quoted Premium")
End If