Help with a User Form problem please

  • Thread starter Thread starter Peter
  • Start date Start date
P

Peter

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
 
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.
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top