Initializing textboxes in a userform


Posted by kim on October 30, 2001 10:27 PM

i have a userform consisting of four textboxes T1 T2 T3 T4. the data for the textboxes is in a worksheet in Columns A, B, C, D. the worksheet contains more than one row of data.

when the userform is shown i want the values from the first row (or whatever row is selected) to be shown in the textboxes.

can anyone help?



Posted by Bob Umlas on October 31, 2001 4:11 AM

Private Sub Userform_Initialize()
n=Activecell.Row
me.T1.Text = cells(n,1).value
me.T2.Text = cells(n,2).value
me.T3.Text = cells(n,3).value
me.T4.Text = cells(n,4).value
End SUb