Transfer multiple Userform Textbox value to cells/columns

djossh

Board Regular
Joined
Jul 27, 2009
Messages
243
Hi.. I have this code below that transfer my "Textbox1" to "Textbox20" to column A. I have another set of Textboxes ("DataBox1" to "Databox20") that i need to transfer to Column B. can anyone help me on this. Thanks


Dim lrow As Long, i As Long
lrow = Cells(Rows.Count, "A").End(xlUp).Row + 1

With Sheet3
i = 1
Do Until i = 20
.Cells(lrow, 1) = Me.Controls("Textbox" & 1 + i)
lrow = lrow + 1
i = i + 1


Loop
End With
 

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
.
It's easier for me if I have the workbook in front of me to work with .. however, see if this works :

Code:
Dim lrow As Long, i As Long
lrow = Cells(Rows.Count, "B").End(xlUp).Row + 1


With Sheet3
i = 1
Do Until i = 20
.Cells(lrow, 2) = Me.Controls("Databox" & 1 + i)
lrow = lrow + 1
i = i + 1




Loop
End With
 
Upvote 0
Hi. Thanks. sorry I did not explained it well. I was thinking of Transferring below sets of textboxes at the same time

"Textbox1" to "Textbox20" to column A
"Databox1" to "Databox20" to column B

Thanks
 
Upvote 0

Forum statistics

Threads
1,223,886
Messages
6,175,195
Members
452,616
Latest member
intern444

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