Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
change label on multipage
I have a Userform with a Multipage on it. On the first page of the
Multipage I have a combobox. What I would like to do is based upon the value of the combobox on the 1st page change the text of a label on Page 2. Is this possible, and if so how, I have tried to Code below but it does not work. If MultiPage1.Pages(0).cboTestType.Value = "Groove Weld" then MultiPage1.Pages(1).lblWeldType.Caption = "Groove Weld" else MultiPage1.Pages(1).lblWeldType.Caption = "Fillet Weld" End if Regards Martin |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
change label on multipage
i just use the label name. thi label is on the 2nd page and depending on if the
checkbox next to it is checked, it dispaly as value If Worksheets("work").Range("u2").Value = True Then Me.CheckBox2 = True With Me.Label2 .Caption = "Click to disable Menu load on startup." .Height = 20 .Width = 80 .Left = 75 End With GoTo Fin: Else Me.CheckBox2 = False With Me.Label2 .Caption = "Click to load Menu on startup." .Height = 20 .Width = 80 .Left = 75 End With End If Fin: -- Gary wrote in message oups.com... I have a Userform with a Multipage on it. On the first page of the Multipage I have a combobox. What I would like to do is based upon the value of the combobox on the 1st page change the text of a label on Page 2. Is this possible, and if so how, I have tried to Code below but it does not work. If MultiPage1.Pages(0).cboTestType.Value = "Groove Weld" then MultiPage1.Pages(1).lblWeldType.Caption = "Groove Weld" else MultiPage1.Pages(1).lblWeldType.Caption = "Fillet Weld" End if Regards Martin |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
change label on multipage
Here is a generic example. You will need to change the object names as
needed. This code belongs to your combobox_change event code. Private Sub ComboBox1_Change() If Me.ComboBox1.Value = "Groove Weld" Then Me.Label1.Caption = "Groove Weld" Else Me.Label1.Caption = "Fillet Weld" End If End Sub Mike F wrote in message oups.com... I have a Userform with a Multipage on it. On the first page of the Multipage I have a combobox. What I would like to do is based upon the value of the combobox on the 1st page change the text of a label on Page 2. Is this possible, and if so how, I have tried to Code below but it does not work. If MultiPage1.Pages(0).cboTestType.Value = "Groove Weld" then MultiPage1.Pages(1).lblWeldType.Caption = "Groove Weld" else MultiPage1.Pages(1).lblWeldType.Caption = "Fillet Weld" End if Regards Martin |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
change label on multipage
your code worked fine for me:
Private Sub cboTestType_Click() If MultiPage1.Pages(0).cboTestType.Value = "Groove Weld" Then MultiPage1.Pages(1).lblWeldType.Caption = "Groove Weld" Else MultiPage1.Pages(1).lblWeldType.Caption = "Fillet Weld" End If End Sub Private Sub UserForm_Initialize() cboTestType.AddItem "Groove Weld" cboTestType.AddItem "Fillet Weld" End Sub -- Regards, Tom Ogilvy wrote in message oups.com... I have a Userform with a Multipage on it. On the first page of the Multipage I have a combobox. What I would like to do is based upon the value of the combobox on the 1st page change the text of a label on Page 2. Is this possible, and if so how, I have tried to Code below but it does not work. If MultiPage1.Pages(0).cboTestType.Value = "Groove Weld" then MultiPage1.Pages(1).lblWeldType.Caption = "Groove Weld" else MultiPage1.Pages(1).lblWeldType.Caption = "Fillet Weld" End if Regards Martin |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
MultiPage change CRASH! | Excel Programming | |||
change from page1 to page2 of MultiPage object | Excel Programming | |||
Deactivating Multipage Change Event | Excel Programming | |||
Deactivating Multipage Change Event | Excel Programming | |||
Change the background color on a multipage control? | Excel Programming |