link a cell into a vba form

  • Thread starter Thread starter newman
  • Start date Start date
N

newman

I have create a simple for for the user to enter three
variables. What I want to is to have that information go
into a particular cell. Can anyone tell me how to link
that infoprmtion entered from the form to the cell in the
worksheet

Regards

Newman
 
You can't link three textboxes to a single cell in a meaningful way. Link
each to a separate cell, then use a fourth cell to combine the information
if that is what you need. In the property of each textbox, under the
controlsource property, put in an entry like

Sheet1!A1
 
Tom

Thank you I worked that one out is it possible to turn
that text input to a date selection rop down box

Regards

Newman
 
Assuming a combobox from the control toolbox toolbar on a worksheet.

Private Sub CommandButton2_Click()
Dim cbox As MSForms.ComboBox
Dim ctrl As MSForms.Control
Set cbox = ActiveSheet.OLEObjects("Combobox1").Object
cbox.Clear
For Each ctrl In UserForm1.Controls
If TypeOf ctrl Is MSForms.TextBox Then
Set tbox = ctrl
If Len(Trim(tbox.Text)) <> 0 Then
If IsDate(tbox.Text) Then
cbox.AddItem tbox.Text
End If
End If
End If
Next

End Sub
 
Back
Top