View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
jason jason is offline
external usenet poster
 
Posts: 104
Default Passing ARGUMENTS between event procedures of a USERFORM

Bob,

There is just one textbox and about 30 checkboxes.The form should
initialise with an empty textbox - easy enough:

txtInstructions = ""

When a checkbox is checked a certain set of instructions (a public
constant called, for example - instrAutofit) should appear in the
textbox that relate to the most recently checked box.I've shortened
things abit an I think I'll be ok, and just have to repeat the below
code 30 times:

Private Sub CheckBox1_Click()
If CheckBox1 Then textbox1 = instrAutofit
End Sub

I was hoping to not have to repeat this for every checkbox - but it
isn't such a hardship (...I suppose)

Thanks Bob,
Jason


"Bob Phillips" wrote in message ...
Jason,

I am not clear how the different checkboxes get set, and how you control
them. Can you post some code that shows what happens for say just 2
textboxes and I will see if I can assist?

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"jason" wrote in message
om...


Cheers Bob,

I've got loads of check boxes and I think I'm gonna have to use:

Private Sub ChkAutofit_Click()
If ChkAutofit then
TextBox1.Text = instrAutofit
else
TextBox1.Text = ""
end if
End Sub

So with the 30 checkboxes I've got its gonna run into a fair bit of
code - I was hoping to use an argument to cut down on the code
Any ideas matey??

Jason.