Userform display control

UHsoccer

Well-known Member
Joined
Apr 3, 2002
Messages
1,023
Using the following code to show/hide Labels and OptionButtons on a Userform

Code:
UserForm1.Label5.Visible = False
UserForm1.OptionButton2.Visible = False

They still show, any ideas
?
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
The instructions are correct. As long as the userform1 is visible.


And at what time do you run those lines? when do you press a button?
Or what must happen to run those lines?
 
Upvote 0
Checked throughout but could not locate any, Here is a copy of the code

Code:
If Sheets("CtlPgm").Range("BB7") = 0 Then ' no Obsolete  UserForm1.Label5.Visible = False
        UserForm1.OptionButton1.Visible = False
        UserForm1.OptionButton2.Visible = False
        UserForm1.Label5.Visible = False
        UserForm1.Label5.Caption = "Obs-- (0)"
        If msgShowHide = "Yes" Then Auto_Trace "In-Form1-Init hide Obsolete CtlPgm-BB7 Label5, Button 1,2"
    Else
        UserForm1.OptionButton1.Visible = True
        UserForm1.OptionButton2.Visible = True
        UserForm1.Label5.Caption = "Obs- (" & Sheets("CtlPgm").Range("BB7") & ")"
        UserForm1.Label5.Visible = True
        If msgShowHide = "Yes" Then Auto_Trace "In-Form1-Init show Obsolete " & Sheets("CtlPgm").Range("BB7") & "  Label 5, Button 1,2"
    End If

Private Sub CommandButton2_Click() ' manage data from button on sheet1

'Auto_Trace "CommandButton2-click - Userform1-show "
Sheets("Sheet1").CommandButton2.BackColor = RGB(102, 255, 0) ' Green
UserForm1.Show

End Sub
 
Last edited:
Upvote 0
And what do you have in this cell?

Code:
[COLOR=#333333]Sheets("CtlPgm").Range("BB7") = 0[/COLOR]

But I still don't see when it goes through these lines.

If you like, you can check your file.

You could upload a copy of your file to a free site such www.dropbox.com. Once you do that, mark it for 'Sharing' and you will be given a link to the file that you can post here. If the workbook contains confidential information, you could replace it with generic data.
 
Upvote 0

Forum statistics

Threads
1,224,813
Messages
6,181,117
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top