Checking Entry

  • Thread starter Thread starter mushy_peas
  • Start date Start date
M

mushy_peas

Is there a way of checking the input of a Msgbox in terms of if it
numeric or alphabetical

eg if i only want alphabetical, and someone enter a number o
alpnumric, then get to to display a warning.

Cheer
 
A MessageBox does not have input. You are probably referring to an InputBox.

Look at Help for the InputBox Method rather than the InputBox Function. The
former allows you control over the input type.
 
sorry, the box is a simple, ie
Colset = InputBox("What column is the PASS Results", "Selec
Results Column"
 
you can use this as a function or embed it in your code

sub MySub(

Colset = InputBox("What column is the PASS Results", "Selec
Results Column"
if IsAlpha(Colset) = False then Msgbox "No numbers allowed" : Exit su

end su

Function IsAlpha(Colset) As Boolea
Dimy As Long, z As Lon
y = Len(colset
For z = 1 To
If Mid(colset, z, 1) Like "[0-9]" The
IsAlpha = Fals
Exit Functio
Nex
IsAlpha = Tru
End Function
 
Function IsAlpha(Colset) As Boolea
Dim y As Long, z As Lon
y = Len(Colset
For z = 1 To
If Mid(x, z, 1) Like "[0-9]" The
IsAlpha = Fals
Exit Functio
End If <<<<<<<<
Nex
IsAlpha = Tru
End Functio







----- chris wrote: ----

you can use this as a function or embed it in your code

sub MySub(

Colset = InputBox("What column is the PASS Results", "Selec
Results Column"
if IsAlpha(Colset) = False then Msgbox "No numbers allowed" : Exit su

end su

Function IsAlpha(Colset) As Boolea
Dimy As Long, z As Lon
y = Len(colset
For z = 1 To
If Mid(colset, z, 1) Like "[0-9]" The
IsAlpha = Fals
Exit Functio
Nex
IsAlpha = Tru
End Function
 
thanks ~ x but its dodnt quite work. even if i enter a number no messag
comes up
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top