Hi,
I had some help earlier to transfer information from a user form into a table using the following code
What this does is transfer the data into the table and places it into a new row, four rows from the bottom. Great.
The first two columns of the table though have formulas to reference data from another work book. Is there a way to add the new rows in and then remove any data from the first two columns? The reason I want this removing is because it brings up the file open window twice due to there being two columns.
Regards
I had some help earlier to transfer information from a user form into a table using the following code
Code:
Private Sub CommandButton2_Click()
Dim emptyRow As Long
Sheet3.Activate
emptyrow = Sheets(3).Range("AS" & Rows.Count).End(xlUp).Row - 3
Rows(emptyrow).Insert
Cells(emptyRow, 4).Value = TextBox1.Value
Cells(emptyRow, 8).Value = ComboBox5.Value
Cells(emptyRow, 9).Value = ComboBox6.Value
Cells(emptyRow, 12).Value = ComboBox7.Value
Cells(emptyRow, 13).Value = ComboBox8.Value
Cells(emptyRow, 16).Value = ComboBox9.Value
Cells(emptyRow, 17).Value = ComboBox10.Value
Cells(emptyRow, 20).Value = ComboBox11.Value
Cells(emptyRow, 21).Value = ComboBox12.Value
Cells(emptyRow, 24).Value = ComboBox13.Value
Cells(emptyRow, 25).Value = ComboBox14.Value
Cells(emptyRow, 39).Value = ComboBox1.Value
Cells(emptyRow, 42).Value = ComboBox2.Value
Cells(emptyRow, 43).Value = ComboBox3.Value
Cells(emptyRow, 44).Value = ComboBox4.Value
If OptionButton5.Value = True Then
Cells(emptyRow, 5).Value = "FT"
Else
Cells(emptyRow, 5).Value = "PT"
End If
If OptionButton1.Value = True Then
Cells(emptyRow, 6).Value = "Y"
Else
Cells(emptyRow, 6).Value = "N"
End If
End Sub
What this does is transfer the data into the table and places it into a new row, four rows from the bottom. Great.
The first two columns of the table though have formulas to reference data from another work book. Is there a way to add the new rows in and then remove any data from the first two columns? The reason I want this removing is because it brings up the file open window twice due to there being two columns.
Regards