I have a userForm to Select week1,2,3, etc and I have code to open the data sheet for week 1, to populate to specific cells Need some help

J1149

New Member
Joined
Jan 20, 2007
Messages
39
I have two userForms one to select week 1, 2, 3, 4, 5. When Week 1 is selected the enter Sygma Delivery userForm shows. Data is then entered and transferred to the appropriate cells. I want to code the form to come up when week 2 or another week is selected and the Sygma delivery worksheets shows and data is entered and transferred to the appropriate cells on the LaborDelivery worksheet for week 2, 3, 4, or 5.

Here is my current code for entering week 1(Data should enter in column X), week 2 would go to the next empty column, then week 3, 4, 5:

Private Sub TransferData1_Click()
Dim irow As Long
Dim ws As Worksheet
Set ws = Worksheets("Sheet1 Populate")
' Inserts Data to very hidden labor worksheet
irow = ws.Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).Row
With ws
.Range("X" & irow) = TextBox1.Value
.Range("X" & irow + 1) = TextBox2.Value
.Range("X" & irow + 2) = TextBox3.Value
.Range("X" & irow + 3) = TextBox4.Value
.Range("X" & irow + 4) = TextBox5.Value
.Range("X" & irow + 5) = TextBox6.Value
.Range("X" & irow + 6) = TextBox7.Value
.Range("Y" & irow + 1) = TextBox8.Value
.Range("Y" & irow + 2) = TextBox9.Value
.Range("Y" & irow + 3) = TextBox10.Value
.Range("Y" & irow + 4) = TextBox11.Value
.Range("Y" & irow + 5) = TextBox12.Value
End With
TextBox1.Value = ""
TextBox2.Value = ""
TextBox3.Value = ""
TextBox4.Value = ""
TextBox5.Value = ""
TextBox6.Value = ""
TextBox7.Value = ""
TextBox8.Value = ""
TextBox9.Value = ""
TextBox10.Value = ""
TextBox11.Value = ""
TextBox12.Value = ""
Unload Me
End Sub


Any help would be greatly appreciated. Thank you, Joe
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.

Forum statistics

Threads
1,215,427
Messages
6,124,831
Members
449,190
Latest member
rscraig11

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