View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Martin Martin is offline
external usenet poster
 
Posts: 336
Default Copy test to form

Private Sub UserForm_Initialize()
Dim myCtrl As Control
For Each myCtrl In Me.Controls
If Left(myCtrl.Name, 3) = "txt" Then myCtrl.Value = Cells(2,
Val(Mid(myCtrl.Name, 4))).Value
Next
End Sub

"SMERTZ" wrote:

What is the best way to copy data from a row, lets say row 2 cells 1 thru 15
to 15 text boxes on a form?

txt1= activeRow column 1
txt2=activeRow column 2
txt3 = active row column 3

You get the idea: Most of the data is Text, but there are a few dates in
the cells