Vlookup in a userform

Jim Stewart

New Member
Joined
Oct 18, 2006
Messages
14
You people are the greatest, a bigggggg help. Maybe you can help with this.
Is there any way to create a userform that a user can enter 2 or 3 variables and cause a search of all the sheets in a workbook to find a record?
Thanks in advance!!!!!
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
Hi,

Just an example;

UserForm1
TextBox1 ; value: Jim
TextBox2 ; value: Erdinç
TextBox3 ; value: Excel

The codes of CommandButton1 ;

Code:
Private Sub CommandButton1_Click()
    Dim Sh As Worksheet
    On Error Resume Next
    For Each Sh In Worksheets
        [B1] = Sh.Name & "!" & Sh.Cells.Find(TextBox1).Address
        [B2] = Sh.Name & "!" & Sh.Cells.Find(TextBox2).Address
        [B3] = Sh.Name & "!" & Sh.Cells.Find(TextBox3).Address
    Next Sh
End Sub


Sheet1 B10 cell value = Jim
Sheet2 D2 cell value = Erdinç
Sheet3 E7 cell value = Excel

Result of codes on Activesheet (B1-B2-B3):

Sheet1!$B$10
Sheet2!$D$2
Sheet3!$E$7
 
Upvote 0

Forum statistics

Threads
1,214,833
Messages
6,121,868
Members
449,053
Latest member
Mesh

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top