![]() |
Populate a form with data from a range
I need to populate the fields of a form with data from a range when the user selects a particular entry from a combo box. Using the selection from the combo box, this routine will find that value in column A of another worksheet in the file and populate all the other fields on the form with data in that row. Any ideas? -- randallwilkins ------------------------------------------------------------------------ randallwilkins's Profile: http://www.excelforum.com/member.php...o&userid=35054 View this thread: http://www.excelforum.com/showthread...hreadid=553375 |
Populate a form with data from a range
Use VLOOKUP for this
say your combobox is in A1 =:VLOOKUP(lookup_value,table_array,col_index_num,r ange_lookup) choose for lookup_value A1 table array, the table of dat you are looking on, eg, Sheet2!A:E col_index num, choose the distance from the value you are looking up, 1 for the same column, 2 for column B:B, acroos the rows etc. range_lookup needs to be 0 if you are looking for exact match. change the col_index num to populate as many fields as you require somethinglikeant randallwilkins wrote: I need to populate the fields of a form with data from a range when the user selects a particular entry from a combo box. Using the selection from the combo box, this routine will find that value in column A of another worksheet in the file and populate all the other fields on the form with data in that row. Any ideas? -- randallwilkins ------------------------------------------------------------------------ randallwilkins's Profile: http://www.excelforum.com/member.php...o&userid=35054 View this thread: http://www.excelforum.com/showthread...hreadid=553375 |
Populate a form with data from a range
Use VLOOKUP for this
say your combobox is in A1 =:VLOOKUP(lookup_value,table_array,col_index_num,r ange_lookup) choose for lookup_value A1 table array, the table of dat you are looking on, eg, Sheet2!A:E col_index num, choose the distance from the value you are looking up, 1 for the same column, 2 for column B:B, acroos the rows etc. range_lookup needs to be 0 if you are looking for exact match. change the col_index num to populate as many fields as you require somethinglikeant randallwilkins wrote: I need to populate the fields of a form with data from a range when the user selects a particular entry from a combo box. Using the selection from the combo box, this routine will find that value in column A of another worksheet in the file and populate all the other fields on the form with data in that row. Any ideas? -- randallwilkins ------------------------------------------------------------------------ randallwilkins's Profile: http://www.excelforum.com/member.php...o&userid=35054 View this thread: http://www.excelforum.com/showthread...hreadid=553375 |
Populate a form with data from a range
I am using VB in Excel. This is the code for one of the fields: Private Sub txtOilGuage_Change() End Sub I want to lookup a well name that was picked in a combobox, look for that well on another worksheet, and populate all the other fields in the form with data from that row. Find the well, look in each of the columns across the row and put the value in the respective field on the form. -- randallwilkins ------------------------------------------------------------------------ randallwilkins's Profile: http://www.excelforum.com/member.php...o&userid=35054 View this thread: http://www.excelforum.com/showthread...hreadid=553375 |
All times are GMT +1. The time now is 04:47 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com