ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Checking Entry (https://www.excelbanter.com/excel-programming/295486-checking-entry.html)

mushy_peas[_24_]

Checking Entry
 
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

--
Message posted from http://www.ExcelForum.com


Vasant Nanavati

Checking Entry
 
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.

--

Vasant


"mushy_peas " wrote in message
...
Is there a way of checking the input of a Msgbox in terms of if its
numeric or alphabetical

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

Cheers


---
Message posted from http://www.ExcelForum.com/




mushy_peas[_25_]

Checking Entry
 
sorry, the box is a simple, ie
Colset = InputBox("What column is the PASS Results", "Selec
Results Column"

--
Message posted from http://www.ExcelForum.com


Chris

Checking Entry
 
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

chris: forgot 'end if'

Checking Entry
 
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

mushy_peas[_26_]

Checking Entry
 
thanks ~ x but its dodnt quite work. even if i enter a number no messag
comes up

--
Message posted from http://www.ExcelForum.com



All times are GMT +1. The time now is 11:33 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com