Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming,microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default User Form Help

Hi,

can any one help me please ?

What I'm trying do to use combo box on a form I have created which
will display data in column 'A' e.g. Zip codes

When the user has found the Zip code they require in Column A, and
pressed the OK button the associated data in columns B, C & D will be
displayed in the Text box on the form

e.g. the user uses the combo box is used to select data in A12

Then press the OK Button

The data in B12, C12, D12 is displayed in the text box


Any assistance would be appreciated


Many thanks


Rob

NB Excel version 2000

  #2   Report Post  
Posted to microsoft.public.excel.programming,microsoft.public.excel.misc
external usenet poster
 
Posts: 212
Default User Form Help

You can do Find, within colum A, for the selected data, and get the row
number. With row number known, you can then display the data in same row for
columns B, C and D in the text box.

Sharad

wrote in message
...
Hi,

can any one help me please ?

What I'm trying do to use combo box on a form I have created which
will display data in column 'A' e.g. Zip codes

When the user has found the Zip code they require in Column A, and
pressed the OK button the associated data in columns B, C & D will be
displayed in the Text box on the form

e.g. the user uses the combo box is used to select data in A12

Then press the OK Button

The data in B12, C12, D12 is displayed in the text box


Any assistance would be appreciated


Many thanks


Rob

NB Excel version 2000



  #3   Report Post  
Posted to microsoft.public.excel.programming,microsoft.public.excel.misc
external usenet poster
 
Posts: 27,285
Default User Form Help

Private Sub Userform_Initialize()
Dim rng as Range
With Worksheets("Sheet1")
set rng = .Range(.Cells(2,1),.Cells(2,1).end(xldown))
End With
Combobox1.RowSource = rng.Address(External:=True)
End sub

Private Sub Combobox1_Click()
Dim rng as Range
With Combobox1
set rng = Range(.Rowsource)
Textbox1.Text = rng(.ListIndex + 1,2)
Textbox2.Text = rng(.ListIndex + 1,3)
Textbox3.Text = rng(.ListIndex + 1,4)
End With
End Sub

No reason to use a commandbutton since you can have the selection trigger
the populating of the textboxes. If you want a command button, then put the
code in the Combobox1_click event in the CommandButton1_Click event.

--
Regards,
Tom Ogilvy




wrote in message
...
Hi,

can any one help me please ?

What I'm trying do to use combo box on a form I have created which
will display data in column 'A' e.g. Zip codes

When the user has found the Zip code they require in Column A, and
pressed the OK button the associated data in columns B, C & D will be
displayed in the Text box on the form

e.g. the user uses the combo box is used to select data in A12

Then press the OK Button

The data in B12, C12, D12 is displayed in the text box


Any assistance would be appreciated


Many thanks


Rob

NB Excel version 2000



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


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I fill a cell in a user form from a selection on same form? Terry Tipsy Excel Discussion (Misc queries) 4 June 11th 07 02:59 PM
User Form Obi-Wan Kenobi Excel Discussion (Misc queries) 1 March 23rd 06 07:21 PM
I am looking to see if anybody has an equivalant user form to Outlooks CONTACT form BruceJ[_2_] Excel Programming 2 October 15th 03 05:28 PM
VBA User form Neil Bhandar Excel Programming 1 September 26th 03 07:25 PM


All times are GMT +1. The time now is 09:21 AM.

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

About Us

"It's about Microsoft Excel"