Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sorry, I misread the OP as being simpler than it was.
Let's assume you populated the ComboBox with the values from column A, in the same order as they appear on the sheet. This leaves row 1 from the sheet in ListIndex 0 of the combobox. The following Change event would put column B of the selected item into TextBox1 '''''''''''' Private Sub ComboBox1_Change() With ThisWorkbook.Sheets("Sheet1") TextBox1.Text = .Cells(ComboBox1.ListIndex + 1, 2) End With End Sub '''''''''''' Tested using the following UserForm_Initialize event: Private Sub UserForm_Initialize() Dim i& With ThisWorkbook.Sheets("Sheet1") For i& = 1 To 10 ComboBox1.AddItem .Cells(i&, 1).Value Next i& End With End Sub Steve Garman wrote: Assuming your GUI is a userform with a ComboBox called ComboBox1 and a Textbox called TextBox1, take a look at the Change event. Something like this should do the trick: Private Sub ComboBox1_Change() TextBox1.Text = ComboBox1.Value End Sub Bill Burke wrote: Hello, I am NEW to automating Excel. I have gone into the macro editor and am "designing" a GUI for a large Excel spreadsheet. Right now I have one drop down list box and several fields (text boxes). I have figured out how to automatically populate the list box with values from one of the columns in the spreadsheet. What I'd like to do now is: Once I select a value in the list box (server name) I would like for the fields (test boxes on the GUI) to automatically populate with the appropriate cell values from the row where the server name appears. I don't know how to do this. Help!!! Any suggestions will be greatly appreciated. TIA, Bill Burke |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Excel macro to populate Outlook email? | Excel Discussion (Misc queries) | |||
How can I have Excel cells populate a Word label template? | Excel Discussion (Misc queries) | |||
Please help a newbie with an excel vba macro relating to comments. | Excel Discussion (Misc queries) | |||
how do i set up drop down menus to populate cells in excel? | Excel Discussion (Misc queries) | |||
Excel VBA -Force users to populate custom form cells | Excel Programming |