Thread: Columnbound?
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Rowan Drummond[_3_] Rowan Drummond[_3_] is offline
external usenet poster
 
Posts: 414
Default Columnbound?

Assuming data on Sheet2 try something like:

Private Sub cmbName_Change()
Dim fndName As Range
With Sheets(2).Columns(1) '<<change as required
Set fndName = .Find(Me.cmbName.Value)
End With
If Not fndName Is Nothing Then
Me.lblAge.Caption = fndName.Offset(0, 1).Value
Me.lblCase.Caption = fndName.Offset(0, 2).Value
Me.lblFile.Caption = fndName.Offset(0, 3).Value
End If
DoEvents
End Sub

Hope this helps
Rowan

rahul25 wrote:
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
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.