Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Lookup and User form
Assuming that you are triggering this with a command button on your user form
and the value is enetered in a combobox on the user form something like this might work. havent tested this though. I would be tempeted to name your ranges rather than use ("a:a") though. Private Sub CommandButton1_Click() v = userform1.combobox1.value With Worksheets("Sheet1").Range("a:a") Set c = .Find(v, LookIn:=xlValues) If Not c Is Nothing Then firstAddress = c.Address Do With Worksheets("sheet2").Range("a:a") Set d = .Find("", LookIn:=xlValues) If Not d Is Nothing Then firstAddress = d.Address Do d.Value = c.value d.Offset(0, 1).Value = c.offset(0,1).value d.Offset(0, 2).Value = c.offset(0,2).value Loop While d Is Nothing End If End With Loop While c Is Nothing End If End With End Sub This should place your results in the first blank cell in column A in sheet 2. Tell me how you get on. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Lookup Function in user form | Excel Programming | |||
Date field in user form & Loading a user form on opening workbook | Excel Programming | |||
Creating Lookup User Form | Excel Programming | |||
Looking to create a simple user form with lookup | Excel Discussion (Misc queries) | |||
How to: User Form to assign a user defined range to a macro variab | Excel Programming |