LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default How to use combobox contents to get information for userform

don't use something like vlookup, use vloopup

Dim res as Variant
res =
Application.Vlookup(Range("A1"),Worksheets("Sheet2 ").Range("A1:E200),4,False
)
if not iserror(res) then
msgbox "Returned value is " & res
End if

or to make it easier to do what you want, use Match instead

Dim res as Variant
set rng = Worksheets("Sheet2").Range("A1:E200")
res = Application.Match(Range("A1"), rng,0)
if not iserror(res) then
set rng1 = rng(res).offset(0,4)
msgbox "value returned is: " & res & " at " & rng1.Address(0,0,xlA1,True)
End if

now you can use rng1 to update the cell.


--
Regards,
Tom Ogilvy


"Cheryl" wrote in message
...
I have a user form that contains a combobox that displays all of our

vendors. When I select a vendor, I want to use VBA to retrieve the data for
that vendor such as address.. How do I do this using something similar to
vlookup on the worksheet. Basically, once I display the data.. I want to be
able to edit it.. such as fixing the address and write back to the excel
table it used to retrieve the information..

Thanks in advance for your suggestions or link to a useful resource where

I can find out how to use it...


 
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
Value From ComboBox On UserForm jlclyde Excel Discussion (Misc queries) 3 October 16th 09 01:43 PM
Userform, ComboBox, and Workbooks... Oh my!? fail2excel Excel Discussion (Misc queries) 3 July 31st 09 09:22 PM
ComboBox on a UserForm LLoyd Excel Worksheet Functions 2 February 20th 08 09:01 PM
Yet another userform combobox question teepee Excel Discussion (Misc queries) 4 May 17th 07 10:03 AM
Userform w/ComboBox D.Parker Excel Discussion (Misc queries) 2 May 6th 05 04:28 PM


All times are GMT +1. The time now is 06:13 AM.

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

About Us

"It's about Microsoft Excel"