Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default Passing variable among controls

I have searched previous posts and found how to pass a value from a
module to a form or a value from a form to a module. My problem is a
little different. I want to pass a value within a userform from a
textbox to a command button.

I have a userform which has 3 rows of TextBoxes. When the form is
called, only one row is visible (the other two are hidden). The user
enters data into the TextBoxes. Now when the commandbutton is clicked
the second set of TextBoxes becomes visible. OK so far. When data is
entered into the second set of TextBoxes a flag is set. Now when the
commandbutton is clicked, using an if...then construct I want to call
up the third set of TextBoxes. The problem is that the flag value does
not transfer to the commandbutton. I have declared the flag as a
public variable in the declarations area of the calling module but that
doesn't seem to help.

Any suggestons

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default Passing variable among controls

Gary,

I still don't understand how you would pass the value (flag) from the
TextBox to the spreadsheet then get it back to the command button.
Remember that the code in the command button runs with each click
event. I tried an if....then....else code but it requires that the
flag be transferred into the command button on the second command
button click event.

Garry

On Jan 25, 12:10 pm, Gary Brown
wrote:
How about putting the variable in a hidden/very hidden worksheet and
referencing it that way?
--
HTH,
Gary Brown

If this post was helpful to you, please select ''YES'' at the bottom of the
post.



" wrote:
I have searched previous posts and found how to pass a value from a
module to a form or a value from a form to a module. My problem is a
little different. I want to pass a value within a userform from a
textbox to a command button.


I have a userform which has 3 rows of TextBoxes. When the form is
called, only one row is visible (the other two are hidden). The user
enters data into the TextBoxes. Now when the commandbutton is clicked
the second set of TextBoxes becomes visible. OK so far. When data is
entered into the second set of TextBoxes a flag is set. Now when the
commandbutton is clicked, using an if...then construct I want to call
up the third set of TextBoxes. The problem is that the flag value does
not transfer to the commandbutton. I have declared the flag as a
public variable in the declarations area of the calling module but that
doesn't seem to help.


Any suggestons- Hide quoted text -- Show quoted text -


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
Passing variable among controls [email protected] Excel Programming 0 January 25th 07 05:46 PM
Passing Controls on a form between modules Graham Y[_2_] Excel Programming 1 November 6th 06 12:50 PM
Passing variable to VarType of other Variable ExcelMonkey[_190_] Excel Programming 3 February 22nd 05 01:38 PM
Passing a variable between workbooks Rich Cooper Excel Programming 1 May 19th 04 07:27 PM
Passing variable from one sub to another Medemper Excel Programming 0 February 26th 04 10:23 PM


All times are GMT +1. The time now is 08:14 AM.

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

About Us

"It's about Microsoft Excel"