Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 343
Default Vlookup using ComboBox value

Is there any way to get this to work?

ComboBox1 has an employee's name. Employee List is not the active worksheet.




If Range("$A$3") = "Monday" Then

TextBox4.Text = VLOOKUP(ComboBox1.Value,'Employee
List'!$A$4:$H$1000,3,FALSE)

End If

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 364
Default Vlookup using ComboBox value

try creating a range name on that sheet and use it in the listbox code
instead and se if that works
TextBox4.Text = VLOOKUP(ComboBox1.Value,rngname,3,FALSE)
--


Gary K



"Patrick C. Simonds" wrote in message
...
Is there any way to get this to work?

ComboBox1 has an employee's name. Employee List is not the active
worksheet.




If Range("$A$3") = "Monday" Then

TextBox4.Text = VLOOKUP(ComboBox1.Value,'Employee
List'!$A$4:$H$1000,3,FALSE)

End If


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 343
Default Vlookup using ComboBox value

I get a Variable no defined error, and Employees is highlighted. Scope is
set to workbook. Here is my current code:


If Range("$A$3") = "Monday" Then
TextBox4.Text = VLookup(ComboBox1.Value, Employees, 3, False)

End If


"Gary Keramidas" wrote in message
...
try creating a range name on that sheet and use it in the listbox code
instead and se if that works
TextBox4.Text = VLOOKUP(ComboBox1.Value,rngname,3,FALSE)
--


Gary K



"Patrick C. Simonds" wrote in message
...
Is there any way to get this to work?

ComboBox1 has an employee's name. Employee List is not the active
worksheet.




If Range("$A$3") = "Monday" Then

TextBox4.Text = VLOOKUP(ComboBox1.Value,'Employee
List'!$A$4:$H$1000,3,FALSE)

End If



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 364
Default Vlookup using ComboBox value

I thought you were trying to set the rowsource of another sheet. but anyway
this woroks for me.

I set up a form with a combobox, 4 textboxes and a command button.
on sheet1 I created a range name employees, from i9:m12
names were listed in column I

I set the rowsource for the combobox to employees

when I loaded the form and clicked the command button, textbox4 filled in

Private Sub CommandButton1_Click()
Dim rng As Range
Set rng = Range("employees")
Me.TextBox4.Text = Application.VLookup(ComboBox1.Value, rng, 3, False)
End Sub

--


Gary K



"Patrick C. Simonds" wrote in message
...
I get a Variable no defined error, and Employees is highlighted. Scope is
set to workbook. Here is my current code:


If Range("$A$3") = "Monday" Then
TextBox4.Text = VLookup(ComboBox1.Value, Employees, 3, False)

End If


"Gary Keramidas" wrote in message
...
try creating a range name on that sheet and use it in the listbox code
instead and se if that works
TextBox4.Text = VLOOKUP(ComboBox1.Value,rngname,3,FALSE)
--


Gary K



"Patrick C. Simonds" wrote in message
...
Is there any way to get this to work?

ComboBox1 has an employee's name. Employee List is not the active
worksheet.




If Range("$A$3") = "Monday" Then

TextBox4.Text = VLOOKUP(ComboBox1.Value,'Employee
List'!$A$4:$H$1000,3,FALSE)

End If



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 343
Default Vlookup using ComboBox value

Thank you, that did the trick.




"Gary Keramidas" wrote in message
...
I thought you were trying to set the rowsource of another sheet. but anyway
this woroks for me.

I set up a form with a combobox, 4 textboxes and a command button.
on sheet1 I created a range name employees, from i9:m12
names were listed in column I

I set the rowsource for the combobox to employees

when I loaded the form and clicked the command button, textbox4 filled in

Private Sub CommandButton1_Click()
Dim rng As Range
Set rng = Range("employees")
Me.TextBox4.Text = Application.VLookup(ComboBox1.Value, rng, 3, False)
End Sub

--


Gary K



"Patrick C. Simonds" wrote in message
...
I get a Variable no defined error, and Employees is highlighted. Scope is
set to workbook. Here is my current code:


If Range("$A$3") = "Monday" Then
TextBox4.Text = VLookup(ComboBox1.Value, Employees, 3, False)

End If


"Gary Keramidas" wrote in message
...
try creating a range name on that sheet and use it in the listbox code
instead and se if that works
TextBox4.Text = VLOOKUP(ComboBox1.Value,rngname,3,FALSE)
--


Gary K



"Patrick C. Simonds" wrote in message
...
Is there any way to get this to work?

ComboBox1 has an employee's name. Employee List is not the active
worksheet.




If Range("$A$3") = "Monday" Then

TextBox4.Text = VLOOKUP(ComboBox1.Value,'Employee
List'!$A$4:$H$1000,3,FALSE)

End If





Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
VLOOKUP, linked cell &combobox Jaan Excel Worksheet Functions 0 December 11th 06 01:41 PM
Combobox items determined by the selection in another combobox Alerion Excel Programming 2 September 13th 06 01:07 PM
big trouble with combobox/vlookup soulfear Excel Discussion (Misc queries) 1 May 11th 06 07:55 AM
combobox with vlookup soulfear Excel Discussion (Misc queries) 0 May 9th 06 03:30 AM
vlookup in combobox Gary Keramidas Excel Programming 6 December 2nd 05 12:37 AM


All times are GMT +1. The time now is 09:31 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"