Userform Textboxes

JeremySun

Board Regular
Joined
Jul 1, 2011
Messages
98
Is there a way to copy all the data in textboxes on a userform? Basically I have 24 textboxes and I want to copy all the textboxes with data and place on a word doc.
 

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
Hi, yes.

if you are testing data then something like


Code:
dim words as string
 
words = ""
 
if textbox1.text <> "" then
words = words + textbox1.text
 
elseif textbox2.text <> "" then
words = words + textbox2.text
 
elseif textbox3.text <> "" then
words = words + textbox3.text
 
elseif textbox4.text <> "" then
words = words + textbox4.text
 
elseif textbox5.text <> "" then
words = words + textbox5.text
etc etc all the way down to 24. then words would equal the sum of the textboxs. just remeber if you want a space at the end to put

Code:
words = words + textbox5.text & " "
 
Upvote 0
the above should copy them all. if not try

Code:
words = textbox1.text & textbox2.text & textbox3.text & textbox4.text

etc etc up to 24 again :)
 
Upvote 0

Forum statistics

Threads
1,224,597
Messages
6,179,813
Members
452,945
Latest member
Bib195

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