View Row Data in UserForm / Edit

P

Pete T

I have an UserForm which staff uses to initiate entries on a
WorkSheet. I now need to activate that same UserForm and populate the
fields with data from a selected row, so staff can edit enties.

If I click on a Cell in a row of data, how do I:

1. Capture the row number for use in the formula - say R is Rows
UserForm.ADate.Value = Worksheets("Contacts").Cells(R,2).Value

2. Load the UserForm with that data from the selected Row.

That's enough for now. Appreciate any directions.
 
S

steve

Pete,

Private Sub UserForm_Initialize()
TextBox1.ControlSource = "$A$" & ActiveCell.Row
TextBox2.ControlSource = "$B$" & ActiveCell.Row
End Sub

will tie the Textbox1 to cell A and row. Now any changes to the text box
will input directly to the cell and anything that is already in the cell
will
appear in the textbox.
Complete the sub with all your objects.

Then use UserForm1.Show in your macro.
 

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

Top