link a cell into a vba form

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
 
T

Tom Ogilvy

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
 
G

Guest

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
 
T

Tom Ogilvy

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
 

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