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
and so on.
I thought I might be able to simplify using:
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.
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
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
Can anyone suggest a simpler way than using 80 lines of code? I've gone blank.