Hi All, Im a vba code stealing/altering noob that is propbably on the wrong track...?
I'm trying to figure out how to use command button click on a userform to transfer textbox and combobox data into specific cells across 100 columns - 1 column at a time. not every cell will contain data on every command click hence needing to be in specific cells and not find next cell or next column item.
The userform needs to re-set and next column selection begin up until a quantity is reached (quantity is in Cell B22)
Can anybody please point me in the right direction?
Cheers in advance
Private Sub CommandButton3_Click()
Dim i As Integer
For i = 3 To 103
Dim ws As Worksheets
Set ws = Worksheets("Frame Input")
With ws
.Cells(C23, i).Value = TextBox5.Text
.Cells(C25, i).Value = TextBox3.Text
.Cells(C28, i).Value = ComboBox1.Text
.Cells(C29, i).Value = TextBox1.Text
.Cells(C30, i).Value = TextBox2.Text
.Cells(C24, i).Value = ComboBox19.Text
.Cells(C31, i).Value = ComboBox4.Text
.Cells(C39, i).Value = ComboBox2.Text
.Cells(C51, i).Value = ComboBox3.Text
.Cells(C35, i).Value = ComboBox24.Text
.Cells(C32, i).Value = ComboBox25.Text
.Cells(C63, i).Value = ComboBox5.Text
.Cells(C115, i).Value = ComboBox7.Text
.Cells(C167, i).Value = ComboBox8.Text
.Cells(C371, i).Value = ComboBox15.Text + " " + ComboBox16.Text
.Cells(C323, i).Value = ComboBox12.Text
.Cells(C347, i).Value = ComboBox13.Value
.Cells(C378, i).Value = ComboBox14.Text
.Cells(C385, i).Value = ComboBox26.Text
.Cells(C392, i).Value = ComboBox17.Text + " " + ComboBox18.Text
.Cells(C219, i).Value = ComboBox9.Text
.Cells(C271, i).Value = ComboBox10.Text
.Cells(C471, i).Value = ComboBox11.Text
.Cells(C472, i).Value = ComboBox20.Text
.Cells(C473, i).Value = ComboBox21.Text
.Cells(C474, i).Value = ComboBox22.Text
.Cells(C475, i).Value = ComboBox23.Text
End With
Next i
End Sub
Bookmarks