Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Columnbound?


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.


--
rahul25
------------------------------------------------------------------------
rahul25's Profile: http://www.excelforum.com/member.php...o&userid=28899
View this thread: http://www.excelforum.com/showthread...hreadid=490070

  #2   Report Post  
Posted to microsoft.public.excel.programming
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.


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 12:51 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"