Home |
Search |
Today's Posts |
#20
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi AMK4,
Just in case the line breaks are a problem (which they probably aren't for you) here's the code in direct pastable form (I hope, it's always a gamble) Sub copyData() Dim myPageInput 'was String Dim ValidPage As Boolean Do While Not ValidPage myPageInput = Application.InputBox( _ prompt:="Which form should this go on? (1 through 4)", _ Title:="Form number", Type:=2) 'Your 2nd AND in next line made no difference so I took it out If Application.IsLogical(myPageInput) And myPageInput < True _ Then Exit Sub ValidPage = True 'with variant myPageInput next three lines work On Error Resume Next If myPageInput < 1 _ Or myPageInput 4 _ Or Int(myPageInput) < CSng(myPageInput) Then 'back in '+ test for integer On Error GoTo 0 ValidPage = False 'back in End If 'back in If Not ValidPage Then _ MsgBox "Only values between 1 and 4 are allowed.", 16 'back in Loop MsgBox "myPageInput: " & myPageInput, 64 End Sub Ken Johnson |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
checking input in a cell and return by copying info from a other c | Excel Worksheet Functions | |||
Spell Checking with checking cell notes | Excel Discussion (Misc queries) | |||
checking input on a textbox in userform to be a % | Excel Programming | |||
Checking input for alphabet (i.e. words) | Excel Programming | |||
CODE to select range based on User Input or Value of Input Field | Excel Programming |