Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
vlookup
Would it be possible to use a variable returned by a ListBox, on a UserForm,
to place a value in a TextBox on the same UserForm? Maybe on a ListBoxClick routine. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
vlookup
Hi Patrick
If I have understood you correctly, try.... Private Sub ListBox1_Click() Dim i As Integer TextBox1 = "" For i = 0 To ListBox1.ListCount - 1 If ListBox1.Selected(i) Then TextBox1 = ListBox1.List(i) Exit Sub End If Next i End Sub -- XL2003 Regards William "Patrick Simonds" wrote in message ... Would it be possible to use a variable returned by a ListBox, on a UserForm, to place a value in a TextBox on the same UserForm? Maybe on a ListBoxClick routine. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
vlookup
Simpler
Private Sub ListBox1_Click() Dim i As Integer TextBox1.Text = ListBox1.Value End Sub -- HTH RP (remove nothere from the email address if mailing direct) "William" wrote in message ... Hi Patrick If I have understood you correctly, try.... Private Sub ListBox1_Click() Dim i As Integer TextBox1 = "" For i = 0 To ListBox1.ListCount - 1 If ListBox1.Selected(i) Then TextBox1 = ListBox1.List(i) Exit Sub End If Next i End Sub -- XL2003 Regards William "Patrick Simonds" wrote in message ... Would it be possible to use a variable returned by a ListBox, on a UserForm, to place a value in a TextBox on the same UserForm? Maybe on a ListBoxClick routine. |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
vlookup
Private Sub ListBox1_Click()
TextBox1.Text = ListBox1.Value End Sub ;) "Bob Phillips" wrote in message ... Simpler Private Sub ListBox1_Click() Dim i As Integer TextBox1.Text = ListBox1.Value End Sub -- HTH RP (remove nothere from the email address if mailing direct) "William" wrote in message ... Hi Patrick If I have understood you correctly, try.... Private Sub ListBox1_Click() Dim i As Integer TextBox1 = "" For i = 0 To ListBox1.ListCount - 1 If ListBox1.Selected(i) Then TextBox1 = ListBox1.List(i) Exit Sub End If Next i End Sub -- XL2003 Regards William "Patrick Simonds" wrote in message ... Would it be possible to use a variable returned by a ListBox, on a UserForm, to place a value in a TextBox on the same UserForm? Maybe on a ListBoxClick routine. |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
vlookup
Patrick,
You can never have too many superfluous variables :-) Bob "Patrick Molloy" wrote in message ... Private Sub ListBox1_Click() TextBox1.Text = ListBox1.Value End Sub ;) "Bob Phillips" wrote in message ... Simpler Private Sub ListBox1_Click() Dim i As Integer TextBox1.Text = ListBox1.Value End Sub -- HTH RP (remove nothere from the email address if mailing direct) "William" wrote in message ... Hi Patrick If I have understood you correctly, try.... Private Sub ListBox1_Click() Dim i As Integer TextBox1 = "" For i = 0 To ListBox1.ListCount - 1 If ListBox1.Selected(i) Then TextBox1 = ListBox1.List(i) Exit Sub End If Next i End Sub -- XL2003 Regards William "Patrick Simonds" wrote in message ... Would it be possible to use a variable returned by a ListBox, on a UserForm, to place a value in a TextBox on the same UserForm? Maybe on a ListBoxClick routine. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
If (Vlookup 0) working, but what if Vlookup cell does not exist | Excel Worksheet Functions | |||
VLookUp - Does the VLookUp return the exact information? | Excel Worksheet Functions | |||
Vlookup in vlookup - taking the result as array name | Excel Worksheet Functions | |||
Combine VLOOKUP and IF function so #NA isn't returned as a value from VLOOKUP | Excel Discussion (Misc queries) | |||
Vlookup -=VLOOKUP(F9,LookUp1!$A$2:$B$1504,2,FALSE) | New Users to Excel |