View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_6_] Bob Phillips[_6_] is offline
external usenet poster
 
Posts: 11,272
Default Newbie - Input Form Question

Tempy,

It simply goes through all the controls on the from and tests whether it is
a textbox or not. If so, it drops the value into a cell.

Perhaps you could name the textbox as the cell address, such as
txtA1,txtM25, etc, then use

Dim oCtl As Control
Dim i As Long

For Each oCtl In Me.Controls
If TypeOf oCtl Is msforms.TextBox Then
i = i + 1
ActiveSheet.Range(Right(oCtl.Name, _
Len(oCtl.Name) - 3)).Value = oCtl.Text
End If
Next oCtl

This extracts that cell address from the textbox name and saves the value in
that cell.

Any good?

--
HTH

Bob Phillips

"Tempy" wrote in message
...
Thanks a lot Bob,

Please excuse the ignorance, but could you explain abit more how the
loop would work, as it has to place the values in different celss all
over the worksheet.

thanks,

Tempy

*** Sent via Developersdex http://www.developersdex.com ***