Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Label on User Form visible
I have what I think is an easy one, but I'm stuck.
I have a user form were the user is required to make selections in 3 fields, 2 comboboxes and 1 text box. I've placed a label above all three. The first one is set to visible.true, the other two set to visible.false. The first one has text: "Enter Origin First". When the user selects an item from combobox1, then set label1 to visible.false, and label2 visible.true and so on...kind of like having a bit of instruction as the user moves from one field to the next. I've tried code in the label something like: private sub label1_click() if combobox.text < "" then label1.visible = False End if Nothing happens tho, any suggestions? Thanks |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Label on User Form visible
I used .hide on one of my programs and it worked. Yoou don't need the = False Hide and Visiabble should work The hide shouldn't be against the label, it should be on the textbox. "Gimp" wrote: I have what I think is an easy one, but I'm stuck. I have a user form were the user is required to make selections in 3 fields, 2 comboboxes and 1 text box. I've placed a label above all three. The first one is set to visible.true, the other two set to visible.false. The first one has text: "Enter Origin First". When the user selects an item from combobox1, then set label1 to visible.false, and label2 visible.true and so on...kind of like having a bit of instruction as the user moves from one field to the next. I've tried code in the label something like: private sub label1_click() if combobox.text < "" then label1.visible = False End if Nothing happens tho, any suggestions? Thanks |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Label on User Form visible
I am not sure what Joel is working with, but I didn't see a hide property or
method for labels used on Userforms. Private Sub Userform_Initialize() Label1.Visible = True Label2.Visible = False Label3.Visible = False End sub Private Sub Combobox1_Click() Label1.Visible = False Label2.Visible = True Label3.Visible = False End Sub Private Sub Combobox2_Click() Label1.Visible = False Label2.Visible = False Label3.Visible = True End Sub Private Sub Textbox1_Exit() Label1.Visible = False Label2.Visible = False Label3.Visible = False End Sub This only works if the user moves sequentially through your data as you expect. You could also hide the related controls (you don't want selected) as well using the same approach. -- Regards, Tom Ogilvy "Gimp" wrote: I have what I think is an easy one, but I'm stuck. I have a user form were the user is required to make selections in 3 fields, 2 comboboxes and 1 text box. I've placed a label above all three. The first one is set to visible.true, the other two set to visible.false. The first one has text: "Enter Origin First". When the user selects an item from combobox1, then set label1 to visible.false, and label2 visible.true and so on...kind of like having a bit of instruction as the user moves from one field to the next. I've tried code in the label something like: private sub label1_click() if combobox.text < "" then label1.visible = False End if Nothing happens tho, any suggestions? Thanks |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Label on User Form visible
On Feb 14, 1:27 pm, Tom Ogilvy
wrote: I am not sure what Joel is working with, but I didn't see a hide property or method for labels used on Userforms. Private Sub Userform_Initialize() Label1.Visible = True Label2.Visible = False Label3.Visible = False End sub Private Sub Combobox1_Click() Label1.Visible = False Label2.Visible = True Label3.Visible = False End Sub Private Sub Combobox2_Click() Label1.Visible = False Label2.Visible = False Label3.Visible = True End Sub Private Sub Textbox1_Exit() Label1.Visible = False Label2.Visible = False Label3.Visible = False End Sub This only works if the user moves sequentially through your data as you expect. You could also hide the related controls (you don't want selected) as well using the same approach. -- Regards, Tom Ogilvy "Gimp" wrote: I have what I think is an easy one, but I'm stuck. I have a user form were the user is required to make selections in 3 fields, 2 comboboxes and 1 text box. I've placed a label above all three. The first one is set to visible.true, the other two set to visible.false. The first one has text: "Enter Origin First". When the user selects an item from combobox1, then set label1 to visible.false, and label2 visible.true and so on...kind of like having a bit of instruction as the user moves from one field to the next. I've tried code in the label something like: private sub label1_click() if combobox.text < "" then label1.visible = False End if Nothing happens tho, any suggestions? Thanks- Hide quoted text - - Show quoted text - Thanks...Yep, I got it. I did not see the HIDE option either but just switched my code from the label to the combox boxes....all good. And yes, I'm gonna play around with using this on the combo boxes instead of the labels...want to make sure it looks OK...thanks again...! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
COPY LABEL FORM FROM EXCEL TO A LABEL | New Users to Excel | |||
How to: User Form to assign a user defined range to a macro variab | Excel Programming | |||
Label Scroll Bar Properties: Make Visible? | Excel Programming | |||
Refresh label on user form with RefEdit | Excel Programming |