Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default InputBox vs. UserForm for Numerical Data Input


In the absence of any responses, I am proceeding with my attempt.
I have about a 40-word message that the user needs to see whe
inputting the 2- or 3-digit number; this message is definitely too bi
for an InputBox.

Hence, the idea of an UserForm. I have finished with the design of m
Form and it looks great; unfortunately, it doesn't work -- HELP!

In my Form, I have a Label button for my long message and a text bo
for user input of the 2- or 3-digit number.

When I step-thru the macro and the Form opens -- there is a blinkin
vertical cursor adjacent to the right edge of the Value Property (in m
case, "100", which is a string); keying the Enter key has zero impact
if I key any single digit, it is appended to the right edge of 100 an
the macro proceeds to inspect the code for the text box; keyin
'backspace' removes the rightmost digit from 100 and the macro proceed
with inspecting the code for the text box.

I have changed my error testing from "2 or 3 digits?" to calculatin
MIN and MAX values in the main macro (these are variables) and the
testing the user input level, after using "Val" to convert to a number
against this range. I pasted the error testing into the code for th
text box; however, I am not able to get the Form to reappear. Eve
when setting the Value Property at "999" and deleting the right-mos
"9", I can get a MsgBox to display the number, but I am not bringin
that value back to the main macro.

As I said before, HELP.
Chuckles12

--
Chuckles12
-----------------------------------------------------------------------
Chuckles123's Profile: http://www.excelforum.com/member.php...fo&userid=1494
View this thread: http://www.excelforum.com/showthread.php?threadid=27744

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 618
Default InputBox vs. UserForm for Numerical Data Input

Hi

i'm really confused ... would you like to zip up your workbook (containing
the userform & the sheet it supposed to work with etc) and email it direct
to me (julied_ng @ hcts dot net dot au) and i'll have a look at it for you.

Cheers
JulieD

"Chuckles123" wrote in message
...

In the absence of any responses, I am proceeding with my attempt.
I have about a 40-word message that the user needs to see when
inputting the 2- or 3-digit number; this message is definitely too big
for an InputBox.

Hence, the idea of an UserForm. I have finished with the design of my
Form and it looks great; unfortunately, it doesn't work -- HELP!

In my Form, I have a Label button for my long message and a text box
for user input of the 2- or 3-digit number.

When I step-thru the macro and the Form opens -- there is a blinking
vertical cursor adjacent to the right edge of the Value Property (in my
case, "100", which is a string); keying the Enter key has zero impact;
if I key any single digit, it is appended to the right edge of 100 and
the macro proceeds to inspect the code for the text box; keying
'backspace' removes the rightmost digit from 100 and the macro proceeds
with inspecting the code for the text box.

I have changed my error testing from "2 or 3 digits?" to calculating
MIN and MAX values in the main macro (these are variables) and then
testing the user input level, after using "Val" to convert to a number,
against this range. I pasted the error testing into the code for the
text box; however, I am not able to get the Form to reappear. Even
when setting the Value Property at "999" and deleting the right-most
"9", I can get a MsgBox to display the number, but I am not bringing
that value back to the main macro.

As I said before, HELP.
Chuckles123


--
Chuckles123
------------------------------------------------------------------------
Chuckles123's Profile:
http://www.excelforum.com/member.php...o&userid=14948
View this thread: http://www.excelforum.com/showthread...hreadid=277448



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 212
Default InputBox vs. UserForm for Numerical Data Input

I don't know all details of your problem (not read your previous thread),
but it appears that your problem is
you are not able to bring the value of some variable back to the main code.

If the variable is defined in the Form code, it is private variable and you
can not bring it's value to main code.

So define the variable in a Module, as public variable.
E.g. In (any module) :
Public myString as String

so myString is now a public variable and you can set its value in a private
code like code for the form, and bring its value to main code and vice
versa.

Please note define the variable outside the procedure in a module and not in
a procedure!
Sharad

"Chuckles123" wrote in message
...

In the absence of any responses, I am proceeding with my attempt.
I have about a 40-word message that the user needs to see when
inputting the 2- or 3-digit number; this message is definitely too big
for an InputBox.

Hence, the idea of an UserForm. I have finished with the design of my
Form and it looks great; unfortunately, it doesn't work -- HELP!

In my Form, I have a Label button for my long message and a text box
for user input of the 2- or 3-digit number.

When I step-thru the macro and the Form opens -- there is a blinking
vertical cursor adjacent to the right edge of the Value Property (in my
case, "100", which is a string); keying the Enter key has zero impact;
if I key any single digit, it is appended to the right edge of 100 and
the macro proceeds to inspect the code for the text box; keying
'backspace' removes the rightmost digit from 100 and the macro proceeds
with inspecting the code for the text box.

I have changed my error testing from "2 or 3 digits?" to calculating
MIN and MAX values in the main macro (these are variables) and then
testing the user input level, after using "Val" to convert to a number,
against this range. I pasted the error testing into the code for the
text box; however, I am not able to get the Form to reappear. Even
when setting the Value Property at "999" and deleting the right-most
"9", I can get a MsgBox to display the number, but I am not bringing
that value back to the main macro.

As I said before, HELP.
Chuckles123


--
Chuckles123
------------------------------------------------------------------------
Chuckles123's Profile:
http://www.excelforum.com/member.php...o&userid=14948
View this thread: http://www.excelforum.com/showthread...hreadid=277448



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default InputBox vs. UserForm for Numerical Data Input

I think we need to see the code if you want some help.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Chuckles123" wrote in message
...

In the absence of any responses, I am proceeding with my attempt.
I have about a 40-word message that the user needs to see when
inputting the 2- or 3-digit number; this message is definitely too big
for an InputBox.

Hence, the idea of an UserForm. I have finished with the design of my
Form and it looks great; unfortunately, it doesn't work -- HELP!

In my Form, I have a Label button for my long message and a text box
for user input of the 2- or 3-digit number.

When I step-thru the macro and the Form opens -- there is a blinking
vertical cursor adjacent to the right edge of the Value Property (in my
case, "100", which is a string); keying the Enter key has zero impact;
if I key any single digit, it is appended to the right edge of 100 and
the macro proceeds to inspect the code for the text box; keying
'backspace' removes the rightmost digit from 100 and the macro proceeds
with inspecting the code for the text box.

I have changed my error testing from "2 or 3 digits?" to calculating
MIN and MAX values in the main macro (these are variables) and then
testing the user input level, after using "Val" to convert to a number,
against this range. I pasted the error testing into the code for the
text box; however, I am not able to get the Form to reappear. Even
when setting the Value Property at "999" and deleting the right-most
"9", I can get a MsgBox to display the number, but I am not bringing
that value back to the main macro.

As I said before, HELP.
Chuckles123


--
Chuckles123
------------------------------------------------------------------------
Chuckles123's Profile:

http://www.excelforum.com/member.php...o&userid=14948
View this thread: http://www.excelforum.com/showthread...hreadid=277448



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
Userform-allow numerical input? waveracerr[_20_] Excel Programming 2 September 14th 04 08:11 PM
Numerical Input via an inputbox method Tom Ogilvy Excel Programming 0 August 16th 04 07:33 PM
Numerical Input via an inputbox method Bob Phillips[_6_] Excel Programming 0 August 16th 04 07:30 PM
Automatic userform data input into spreadsheet Dan Excel Programming 2 June 11th 04 04:54 PM
Automatic userform to input data to spreadsheet Dan Excel Programming 1 June 11th 04 04:54 PM


All times are GMT +1. The time now is 12:02 AM.

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"