Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default userform control value as constant

Hello

Been trying to find a smooth way around this problem but can't find
anything...Grateful for any advice.
My problem is this:

Have users fill in a userform. Will be using the information entered
in textboxes and chosen from radio buttons over and over again in the
code and send it between functions.

Was hoping to be able to define a public consant but that doesnt work.
Dont want to have to type it eg./ frmrft.cboxA1 all over the place.
Setting myself up for mistakes. What if the A1 is no longer found in
cboxA1 but in txtboxA1...

What I have done until now is define A1 under Ok_click() and then
"sent" it to related functions using Byval. Have ended up with 9 ByVal
for some functions...Is that Ok?

Feels like there should be a better way to do this...

Any suggestions? Anybody?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,420
Default userform control value as constant

Is this what you need?

frmrft.Controls("cbox" & val)

--
__________________________________
HTH

Bob

"littleme" wrote in message
...
Hello

Been trying to find a smooth way around this problem but can't find
anything...Grateful for any advice.
My problem is this:

Have users fill in a userform. Will be using the information entered
in textboxes and chosen from radio buttons over and over again in the
code and send it between functions.

Was hoping to be able to define a public consant but that doesnt work.
Dont want to have to type it eg./ frmrft.cboxA1 all over the place.
Setting myself up for mistakes. What if the A1 is no longer found in
cboxA1 but in txtboxA1...

What I have done until now is define A1 under Ok_click() and then
"sent" it to related functions using Byval. Have ended up with 9 ByVal
for some functions...Is that Ok?

Feels like there should be a better way to do this...

Any suggestions? Anybody?



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default userform control value as constant


Hi!

Thanks for the quick reply... Im not sure if what you suggested is
what I need... How/where would I use it?
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,420
Default userform control value as constant

Difficult to say without seeing the code and a better explanation of what
you are doing.

--
__________________________________
HTH

Bob

"littleme" wrote in message
...

Hi!

Thanks for the quick reply... Im not sure if what you suggested is
what I need... How/where would I use it?



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default userform control value as constant

Ok.. here goes... I'll give it a shot:

Have a userform where users enter information that is used to derive
10-digit drawing number, eg/ A-43-5-33-0751. Woulddnt present a
problem except that depending on the project, sometimes a "/" is use
instead of "-" and sometimes ".", sometimes nothing... So have set ut
4 groups of radio buttons where user can choose if it should be what
"divisor" sould be used at each position. To make it easy for myself i
dumped the value chosen thorugh a radio-button-click statement into
an (invisible) label. This is label value is then referred to and used
alll over the place in the rest of the project. Lables are called
lbA1, lbA2, lbA3, lbA4

In the ok-click I have set A1=lbA1, A2=lbA2 etc.

Follow me so far?

To be able to use the values of A1-A4 in other subs start them with

sub Plans (A1 byval as string, A2 byval as string, A3 byval as string,
A4 byval as string... etc) Have about 8 values that I need...

It works fine, its just that when i want to trigger Plans or any other
sub that also uses A1-A4, have to type

Plan A1:=A1, A2:=A3, A4:=A4 and so forth

Like I said it works, but was wondering if there was a smoother way to
do it..? Or should I just leave it?

Do you understand what Im trying to explain? Am at work and have the
file at home, so could post exact code later today if need be...

sorry


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
Selecting control on userform with part of control name (set question) Keith Excel Programming 4 January 10th 07 02:24 PM
Excel: Format Control: 'cell link' reamins constant. How to copy Rodway N Excel Worksheet Functions 0 September 7th 05 06:21 PM
Control Sequence from Userform Control Nigel Excel Programming 3 December 29th 04 01:25 PM
Userform control ZMore Excel Programming 1 March 5th 04 11:34 PM
Userform control Phillips Excel Programming 1 November 20th 03 07:33 PM


All times are GMT +1. The time now is 06:42 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"