Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
CLR CLR is offline
external usenet poster
 
Posts: 1,998
Default 2-character limit on InputBox

Hi All........
I am using the following line to present the user with a opportunity to
input some data. I would like to accept 0, 1, or 2 characters and reject 3
or more characters for a re-do.....help please

choice1 = InputBox("Enter PlannerCode to search for:")

TIA
Vaya con Dios,
Chuck, CABGx3


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default 2-character limit on InputBox

Neither InputBox nor Application.InputBox have any kind of validation or
input mask so if you either have to validate the input after the fact or
create a form with a text box to do what you want to do. My preference would
be for the form but to each his own...
--
HTH...

Jim Thomlinson


"CLR" wrote:

Hi All........
I am using the following line to present the user with a opportunity to
input some data. I would like to accept 0, 1, or 2 characters and reject 3
or more characters for a re-do.....help please

choice1 = InputBox("Enter PlannerCode to search for:")

TIA
Vaya con Dios,
Chuck, CABGx3


  #3   Report Post  
Posted to microsoft.public.excel.programming
CLR CLR is offline
external usenet poster
 
Posts: 1,998
Default 2-character limit on InputBox

Ok, thanks Jim.......I'll look doing it another way.......you've saved me
from spinning my wheels trying to make this one work.

Vaya con Dios,
Chuck, CABGx3



"Jim Thomlinson" wrote:

Neither InputBox nor Application.InputBox have any kind of validation or
input mask so if you either have to validate the input after the fact or
create a form with a text box to do what you want to do. My preference would
be for the form but to each his own...
--
HTH...

Jim Thomlinson


"CLR" wrote:

Hi All........
I am using the following line to present the user with a opportunity to
input some data. I would like to accept 0, 1, or 2 characters and reject 3
or more characters for a re-do.....help please

choice1 = InputBox("Enter PlannerCode to search for:")

TIA
Vaya con Dios,
Chuck, CABGx3


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,290
Default 2-character limit on InputBox

Chuck,
Maybe this...

Sub WhoAreYou()
Dim choice1 As String
Dim strMsg As String
Do
choice1 = InputBox("Enter PlannerCode to search for:", "Chuck Wants to Know", strMsg)
If Len(choice1) < 3 Then Exit Do
strMsg = "One or two characters only"
Loop
If Len(choice1) = 0 Then
Exit Sub
End If
End Sub
'--
Regards,
Jim Cone


"CLR"
wrote in message
Hi All........
I am using the following line to present the user with a opportunity to
input some data. I would like to accept 0, 1, or 2 characters and reject 3
or more characters for a re-do.....help please

choice1 = InputBox("Enter PlannerCode to search for:")

TIA
Vaya con Dios,
Chuck, CABGx3


  #5   Report Post  
Posted to microsoft.public.excel.programming
CLR CLR is offline
external usenet poster
 
Posts: 1,998
Default 2-character limit on InputBox

BINGO JIM!!!!..........your code works like a champ. Sorry I didn't get back
sooner but I had a computer crash due to lightning yesterday just after you
posted and I didn't get to try it until this morning.......

Happy camper here...........thanks again

Vaya con Dios,
Chuck, CABGx3



"Jim Cone" wrote:

Chuck,
Maybe this...

Sub WhoAreYou()
Dim choice1 As String
Dim strMsg As String
Do
choice1 = InputBox("Enter PlannerCode to search for:", "Chuck Wants to Know", strMsg)
If Len(choice1) < 3 Then Exit Do
strMsg = "One or two characters only"
Loop
If Len(choice1) = 0 Then
Exit Sub
End If
End Sub
'--
Regards,
Jim Cone


"CLR"
wrote in message
Hi All........
I am using the following line to present the user with a opportunity to
input some data. I would like to accept 0, 1, or 2 characters and reject 3
or more characters for a re-do.....help please

choice1 = InputBox("Enter PlannerCode to search for:")

TIA
Vaya con Dios,
Chuck, CABGx3





Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
255 Character Limit Colin Excel Discussion (Misc queries) 2 March 2nd 06 07:58 PM
Msgbox if Inputbox entry contains character Steph[_3_] Excel Programming 1 June 23rd 05 06:02 PM
Limit text length with inputBox BigDave[_7_] Excel Programming 2 June 10th 05 07:11 PM
Inputbox and & character MJR Excel Programming 1 October 20th 04 11:13 PM
InputBox function - prompt string limit Marcotte A[_2_] Excel Programming 4 June 9th 04 09:47 AM


All times are GMT +1. The time now is 03:41 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"