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

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
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
 
Upvote 0

Forum statistics

Threads
1,214,861
Messages
6,121,971
Members
449,059
Latest member
oculus

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