Transfering data from userform to worksheet

GiraffetheGeek

Board Regular
Joined
May 25, 2011
Messages
58
Hi guys,

I have a Userform that will act as an appointment booking tool.

The form has 80 text boxes arranged in four columns of 20.

The first column's text boxes are named

WB_TxtBox_NameWeek1Appt1, then WB_TxtBox_NameWeek1Appt2 until WB_TxtBox_NameWeek1Appt5, then WB_TxtBox_NameWeek2Appt1 - WB_TxtBox_NameWeek2Appt5

and so on for 4 weeks. The second column is named in a similar fashion except the Name is replaced with Dis so the first text box is WB_TxtBox_DisWeek1Appt1

The third column is again the same but with Help instead of Dis or Name and the fourth column uses CM instead of Help, Dis or Name.

I have a worksheet that has cell C3 declared as WB_Start and I want to transfer whatever the user enters into the text boxes to the work sheet in the same format (4 columns, 20 rows)

I could write 80 lines of code
Code:
Range("WB_Start").Value = WB_TxtBox_NameWeek1Appt1.Text
Range("WB_Start").Offset(1, 0).Value = WB_TxtBox_NameWeek1Appt2.Text
and so on.

I thought I might be able to simplify using:
Code:
MoveDown = 1
    MoveRight = 0
    WeekCount = 1
    ApptCount = 1
    Range("WB_Start").Activate
    ActiveCell.Value = Schedule_Workbridge.WB_TxtBox_NameWeek & WeekCount & Appt & ApptCount
then using Do/While loops to increase the count's etc but have figured out that I cannot use concentate with the text box names.

Can anyone suggest a simpler way than using 80 lines of code? I've gone blank.:(
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.

Forum statistics

Threads
1,224,599
Messages
6,179,831
Members
452,947
Latest member
Gerry_F

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