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

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
.
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,216,434
Messages
6,130,611
Members
449,584
Latest member
c_clark

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