Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 172
Default Preloading value into Option Button

I have a a form with Option Buttons. I want to load the
form with one of its buttons at TRUE. The following below
does not work. The form loads with the option button
chosen. Whey is this

PrintHyperLinkOptionButton = True

UserForm1.Show

Thanks
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Preloading value into Option Button

Why not just use

Me.Optionbutton1.Value = True

in the Userform_Activate event?

But be aware, if you have a click event for that button, it will be
triggered.

--

HTH

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


"ExcelMonkey" wrote in message
...
I have a a form with Option Buttons. I want to load the
form with one of its buttons at TRUE. The following below
does not work. The form loads with the option button
chosen. Whey is this

PrintHyperLinkOptionButton = True

UserForm1.Show

Thanks



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 172
Default Preloading value into Option Button

So just our of curiosity Bob. I have not been using a
Userform_Activation event. I have been calling the form
and attempting to set it up prior to the Call stmt as seen
below. Accordingly, I was going to follow through with
the PrintHyperLinkOptionButton = True at the bottom.
Should I move all of this into a Userform_Activation event?

Sub AuditCell()


UserForm1.CircularityChkBx.Enabled = False
UserForm1.InputsChkBx.Enabled = False
UserForm1.ExternalLinkChkBx.Enabled = False
UserForm1.UniqueFormulasChkBx.Enabled = False

UserForm1.PrintColourMapOptionButton.Enabled = False

UserForm1.ComboBox1.Enabled = False

UserForm1.UniqueFormulasAdjustChkBx.Enabled = False

PrintHyperLinkOptionButton = True

UserForm1.Show

End Sub




-----Original Message-----
Why not just use

Me.Optionbutton1.Value = True

in the Userform_Activate event?

But be aware, if you have a click event for that button,

it will be
triggered.

--

HTH

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


"ExcelMonkey" wrote

in message
...
I have a a form with Option Buttons. I want to load the
form with one of its buttons at TRUE. The following

below
does not work. The form loads with the option button
chosen. Whey is this

PrintHyperLinkOptionButton = True

UserForm1.Show

Thanks



.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 172
Default Preloading value into Option Button


This doesn't seem to work:

Private Sub UserForm1_Activate()
Me.PrintHyperLinkOptionButton.Value = True
End Sub

Now I am still using the sub below and your refinement.
Cannot I not do this?

Sub AuditCell()


UserForm1.CircularityChkBx.Enabled = False
UserForm1.InputsChkBx.Enabled = False
UserForm1.ExternalLinkChkBx.Enabled = False
UserForm1.UniqueFormulasChkBx.Enabled = False

UserForm1.PrintColourMapOptionButton.Enabled = False

UserForm1.ComboBox1.Enabled = False

UserForm1.UniqueFormulasAdjustChkBx.Enabled = False

UserForm1.Show

End Sub



-----Original Message-----
Why not just use

Me.Optionbutton1.Value = True

in the Userform_Activate event?

But be aware, if you have a click event for that button,

it will be
triggered.

--

HTH

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


"ExcelMonkey" wrote

in message
...
I have a a form with Option Buttons. I want to load the
form with one of its buttons at TRUE. The following

below
does not work. The form loads with the option button
chosen. Whey is this

PrintHyperLinkOptionButton = True

UserForm1.Show

Thanks



.

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Preloading value into Option Button

That's not a clear-cut question. I think you need to understand the order of
events and work out what is best for your app.

If you set the form as you are doing outwith the form module, then you
automatically load the form if it is not loaded, that is the form is loaded
into memory but not shown.

When you load the form, the Userform_Initialize event is triggered, so you
could put that code in Initialize if it is required to refresh whenever a
for is loaded.

When you show the form the Userform_Activate event is triggered. So you can
add code here that you want every time the form is shown (which you control
via code remember).

The problem (?) with doing it outwith the form module is that it is
effectively Initialize event when you might want it to be Activate event.

Generally speaking, I try to avoid setting the form from a standard code
module, preferring to do it from within the form module itself. Of course,
there are always exceptions, such as hiding (not unloading) a form and
testing a form public property from the standard code module to determine
next action.

--

HTH

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


"ExcelMonkey" wrote in message
...
So just our of curiosity Bob. I have not been using a
Userform_Activation event. I have been calling the form
and attempting to set it up prior to the Call stmt as seen
below. Accordingly, I was going to follow through with
the PrintHyperLinkOptionButton = True at the bottom.
Should I move all of this into a Userform_Activation event?

Sub AuditCell()


UserForm1.CircularityChkBx.Enabled = False
UserForm1.InputsChkBx.Enabled = False
UserForm1.ExternalLinkChkBx.Enabled = False
UserForm1.UniqueFormulasChkBx.Enabled = False

UserForm1.PrintColourMapOptionButton.Enabled = False

UserForm1.ComboBox1.Enabled = False

UserForm1.UniqueFormulasAdjustChkBx.Enabled = False

PrintHyperLinkOptionButton = True

UserForm1.Show

End Sub




-----Original Message-----
Why not just use

Me.Optionbutton1.Value = True

in the Userform_Activate event?

But be aware, if you have a click event for that button,

it will be
triggered.

--

HTH

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


"ExcelMonkey" wrote

in message
...
I have a a form with Option Buttons. I want to load the
form with one of its buttons at TRUE. The following

below
does not work. The form loads with the option button
chosen. Whey is this

PrintHyperLinkOptionButton = True

UserForm1.Show

Thanks



.





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Preloading value into Option Button

That is because the event is cal;led Userform_Activate. It is a form event,
not that form name event :-).

see my other response for the other bit.

--

HTH

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


"ExcelMonkey" wrote in message
...

This doesn't seem to work:

Private Sub UserForm1_Activate()
Me.PrintHyperLinkOptionButton.Value = True
End Sub

Now I am still using the sub below and your refinement.
Cannot I not do this?

Sub AuditCell()


UserForm1.CircularityChkBx.Enabled = False
UserForm1.InputsChkBx.Enabled = False
UserForm1.ExternalLinkChkBx.Enabled = False
UserForm1.UniqueFormulasChkBx.Enabled = False

UserForm1.PrintColourMapOptionButton.Enabled = False

UserForm1.ComboBox1.Enabled = False

UserForm1.UniqueFormulasAdjustChkBx.Enabled = False

UserForm1.Show

End Sub



-----Original Message-----
Why not just use

Me.Optionbutton1.Value = True

in the Userform_Activate event?

But be aware, if you have a click event for that button,

it will be
triggered.

--

HTH

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


"ExcelMonkey" wrote

in message
...
I have a a form with Option Buttons. I want to load the
form with one of its buttons at TRUE. The following

below
does not work. The form loads with the option button
chosen. Whey is this

PrintHyperLinkOptionButton = True

UserForm1.Show

Thanks



.



  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Preloading value into Option Button

Private Sub UserForm1_Activate

should be
Private Sub UserForm_Activate

using the generic Userform

If you select your events from the dropdown, you won't have this problem.

--
Regards,
Tom Ogilvy


"ExcelMonkey" wrote in message
...

This doesn't seem to work:

Private Sub UserForm1_Activate()
Me.PrintHyperLinkOptionButton.Value = True
End Sub

Now I am still using the sub below and your refinement.
Cannot I not do this?

Sub AuditCell()


UserForm1.CircularityChkBx.Enabled = False
UserForm1.InputsChkBx.Enabled = False
UserForm1.ExternalLinkChkBx.Enabled = False
UserForm1.UniqueFormulasChkBx.Enabled = False

UserForm1.PrintColourMapOptionButton.Enabled = False

UserForm1.ComboBox1.Enabled = False

UserForm1.UniqueFormulasAdjustChkBx.Enabled = False

UserForm1.Show

End Sub



-----Original Message-----
Why not just use

Me.Optionbutton1.Value = True

in the Userform_Activate event?

But be aware, if you have a click event for that button,

it will be
triggered.

--

HTH

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


"ExcelMonkey" wrote

in message
...
I have a a form with Option Buttons. I want to load the
form with one of its buttons at TRUE. The following

below
does not work. The form loads with the option button
chosen. Whey is this

PrintHyperLinkOptionButton = True

UserForm1.Show

Thanks



.



  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Preloading value into Option Button

Is there a typo in your explanation?

setting an option button to true Selects it. As written, it sounds like you
have achieved what you desire?

--
Regards,
Tom Ogilvy


"ExcelMonkey" wrote in message
...
I have a a form with Option Buttons. I want to load the
form with one of its buttons at TRUE. The following below
does not work. The form loads with the option button
chosen. Whey is this

PrintHyperLinkOptionButton = True

UserForm1.Show

Thanks



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
Option button Pat Rice New Users to Excel 4 October 31st 08 02:36 PM
Option Button Help PLEASE!! KB Excel Worksheet Functions 1 April 26th 06 06:21 AM
Option Button Pieter van der Walt Excel Discussion (Misc queries) 2 March 27th 06 12:02 PM
keep source formatting is not an option in paste option button Tina Excel Discussion (Misc queries) 0 February 20th 06 09:58 PM
Getting value of Option button BG Excel Worksheet Functions 2 September 27th 05 01:47 PM


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