Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Help with a User Form problem please
Hi,
I have a spreadsheet for which I have created two user forms. The first user form is used for entering data and writing that data to the next free row in my spreadsheet. I want the second user form to select one of the rows that already contains data (by using the unique identifier in column A) and writing additional data to empty cells in that row. I have loaded an example here http://www.nidum.plus.com/Excelform2.html Here for example, I would like the second user form to select the row with the identifier AAA556 and add data to the cells Name 2, Data 3 and Data 4. I have a combo box that shows the data in column A, but cannot work out how to then select that row so the data may be written to the required cells. Can anyone please point me towards a solution? -- Cheers Peter Remove the INVALID to reply |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Help with a User Form problem please
Peter,
The combobox value is obtained using Combobox1.Value You can use this value with a worksheet function to find the row myRow = WorksheetFunction.Match(Combobox1.Value, Activesheet.Range("A:A"),0) and then directly load the cells Activesheet.Cells(myRow,"E").Value = txtName2.Text etc. -- HTH RP "Peter" wrote in message ... Hi, I have a spreadsheet for which I have created two user forms. The first user form is used for entering data and writing that data to the next free row in my spreadsheet. I want the second user form to select one of the rows that already contains data (by using the unique identifier in column A) and writing additional data to empty cells in that row. I have loaded an example here http://www.nidum.plus.com/Excelform2.html Here for example, I would like the second user form to select the row with the identifier AAA556 and add data to the cells Name 2, Data 3 and Data 4. I have a combo box that shows the data in column A, but cannot work out how to then select that row so the data may be written to the required cells. Can anyone please point me towards a solution? -- Cheers Peter Remove the INVALID to reply |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Help with a User Form problem please
On Sat, 9 Oct 2004 11:38:02 +0100, "Bob Phillips"
wrote: Peter, The combobox value is obtained using Combobox1.Value You can use this value with a worksheet function to find the row myRow = WorksheetFunction.Match(Combobox1.Value, Activesheet.Range("A:A"),0) and then directly load the cells Activesheet.Cells(myRow,"E").Value = txtName2.Text etc. many thanks Bob, It worked like a dream - exactly what I was after -- Cheers Peter Remove the INVALID to reply |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Help with a User Form problem please
Good to hear that Peter, and thanks for letting us know.
Bob "Peter" wrote in message ... On Sat, 9 Oct 2004 11:38:02 +0100, "Bob Phillips" wrote: Peter, The combobox value is obtained using Combobox1.Value You can use this value with a worksheet function to find the row myRow = WorksheetFunction.Match(Combobox1.Value, Activesheet.Range("A:A"),0) and then directly load the cells Activesheet.Cells(myRow,"E").Value = txtName2.Text etc. many thanks Bob, It worked like a dream - exactly what I was after -- Cheers Peter Remove the INVALID to reply |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
User Form Problem ??? | New Users to Excel | |||
User form problem | Excel Worksheet Functions | |||
User Form Problem | Excel Discussion (Misc queries) | |||
User Form Problem | Excel Discussion (Misc queries) | |||
problem with user form | Excel Programming |