Copy Text Box and Pull downs to cells

FisherKat

New Member
Joined
Oct 16, 2018
Messages
14
Looking for way to capture data on a form I created in excel, to write the user input data to hidden page column so I can concatenate them to populate the subject line on email that user will create when form is filled out. Data is captured through a combination of Text Boxes and pull downs.
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
I apologize your question is not very clear but it sounds like you are trying to determine how to send data from a TextBox and by pull downs I think you are referring to a ComboBox to an excel sheet.

You will also want to have a Submit or Save button on this Form, within this button you would add the code. Thus when the button is pressed it will send the data currently in the form to the specified location, the button being the trigger.

I am not sure what you named each item but for my example I am using the default names for a TextBox, ComboBox and a Button. (TextBox1, ComboBox1, CommandButton1)

I am having it insert the data from the Textbox and ComboBox into Sheet2 which would be the hidden sheet.

Code:
Private Sub CommandButton1_Click()


'Find last used row
myRange = Cells(Rows.Count, 1).End(xlUp).Row


'Insert the new data on the new row in columns A and B
'TextBox
Sheets("Sheet2").Range("A" & myRange + 1).Value = TextBox1.Text
'ComboBox
Sheets("Sheet2").Range("B" & myRange + 1).Value = ComboBox1.Text


End Sub

Another option would be to concatenate the values within the code instead of inserting them into a sheet to concatenate them and then pick up the value in the email just concatenate it in the code.

For example:
Code:
Private Sub CommandButton1_Click()


'Find last used row
myRange = Cells(Rows.Count, 1).End(xlUp).Row


'Insert the new data on the new row in columns A and B
Sheets("Sheet2").Range("A" & myRange + 1).Value = TextBox1.Text & " " & ComboBox1.Text

End Sub
 
Last edited:
Upvote 0
I appreciate the response Coding4Fun, but I've created a form within excel that people will be using to submit action items to my department. I could send you the sheet since we can no longer provide attachments or images.

Thank you for
 
Upvote 0

Forum statistics

Threads
1,214,522
Messages
6,120,022
Members
448,939
Latest member
Leon Leenders

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top