Columnbound?

rahul25

New Member
Joined
Nov 18, 2005
Messages
8
I created a multipage userform in excel VBA.

userform Page 1 for info data entry
excel sheet sample below

A B C D
Name Age case# file#
1 Mr. x 27 2345 5677
2 Ms. Y 49 2356 5678

userform Page 2 for number of hours worked entry:

Name :Combobox stating row source A1:D2
Age : label 1
Case#: label2
File#: label3
Hours : will type in>

My question is , if I select a name in combobox in userform page 2 , how it is possible to display corresponding data in label 1 , label 2 and label 2 automatically.

Please help.
 

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.

acw

MrExcel MVP
Joined
Feb 13, 2004
Messages
4,814
Hi

One way is with a combobox_change event.

Code:
Private Sub ComboBox1_Change()
 Label1.Caption = WorksheetFunction.VLookup(ComboBox1.Value, Range("a1:d3"), 2, False)
 Label2.Caption = WorksheetFunction.VLookup(ComboBox1.Value, Range("a1:d3"), 3, False)
 Label3.Caption = WorksheetFunction.VLookup(ComboBox1.Value, Range("a1:d3"), 4, False)
End Sub

Update ranges, values, names etc as required.

HTH

Tony
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,163,805
Messages
5,833,766
Members
430,230
Latest member
Yimmie

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
Top