Creating an array from userform textboxes and applying to cell range

pueblorox

New Member
Joined
Feb 4, 2016
Messages
1
I am working on code to take inputted data from a userform and then paste it on a worksheet. I have a loop created to populate fields into the text boxes based on data existing in the sheet. I want to allow the user to update or add data to the text boxes and then fill back into the sheet.
I wrote a bit of code that works, but is very slow. I have used arrays before but I am rusty and I can not seem to get it to work. The code I have looks like this so far..

R = TestNo.Row
TechU = 1

Do
WDay = 1
C = 19
Do
Sheets(DataSheet).Cells(R, C).Value = UserForm2.Controls("D" & WDay & "T" & TechU).Value
WDay = WDay + 1
C = C + 1
Loop Until WDay = 16
'Stop
R = R + 1
TechU = TechU + 1
Loop Until TechU = 10

This user form has a text box that corresponds to a cell on the sheet, 6 rows tall by 16 columns wide. I want to use an array to populate the data to speed up the run time. Can anyone help me, as I said, I cant seem to get an array to populate with the text box values.
 

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.

Forum statistics

Threads
1,223,902
Messages
6,175,278
Members
452,629
Latest member
SahilPolekar

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