MikeCouling
Technical User
I'm just getting to grips with VBA and am trying to set up a User Form (I have been using John Walkenbach's Excel VBA for Dummies - highly recommend it for newbies)
It's a questionnaire. I have put the possible answers for one question in a ListBox. The last option in the ListBox is "Other"; if the user selects that, I want to unlock a text box so they can write their own answer. I have tried the following :-
Private Sub ListBox1_Click()
If ListBox1.Selected(13) Then
TextBox19.Locked = False
TextBox19.BackColor = &HFFFFFF
End If
End Sub
but the text box remains locked and greyed. I guess I need to associate an event with the selection of "Other" but am otherwise stuck. Can anyone help me out? Thanks.
Mike
It's a questionnaire. I have put the possible answers for one question in a ListBox. The last option in the ListBox is "Other"; if the user selects that, I want to unlock a text box so they can write their own answer. I have tried the following :-
Private Sub ListBox1_Click()
If ListBox1.Selected(13) Then
TextBox19.Locked = False
TextBox19.BackColor = &HFFFFFF
End If
End Sub
but the text box remains locked and greyed. I guess I need to associate an event with the selection of "Other" but am otherwise stuck. Can anyone help me out? Thanks.
Mike