Hi,
I am trying to add a new row with specific formulas/dropdown lists. I need to be able to add new row and copy customer name from one cell to specific cell in last row.
Private Sub CommandButton1_Click()
Dim the_sheet As Worksheet
Dim table_list_object As ListObject
Dim table_object_row As ListRow
Set the_sheet = Sheets("PotentialOrders")
Set table_list_object = the_sheet.ListObjects(1)
Set table_object_row = table_list_object.ListRows.add
table_object_row.Range(1, 1).Value = "0"
table_object_row.Range(1, 3).Value = 'Pick up data from cell "C1" everytime and paste it in Column C (last row)'
table_object_row.Range(1, 6).Value = "Enter Potential Shipping Date"
table_object_row.Range(1, 8).Value = "Select Item No."
table_object_row.Range(1, 9).Value = "Select Packing Type"
table_object_row.Range(1, 10).Value = "Enter Quantity"
table_object_row.Range(1, 11).Value = "Enter Unit Price"
With the_sheet.Cells(the_sheet.Rows.Count, "A").End(xlUp)
.Select ' not required to change the focus/view
ActiveWindow.ScrollRow = .Row
End With
End Sub
I am trying to add a new row with specific formulas/dropdown lists. I need to be able to add new row and copy customer name from one cell to specific cell in last row.
Private Sub CommandButton1_Click()
Dim the_sheet As Worksheet
Dim table_list_object As ListObject
Dim table_object_row As ListRow
Set the_sheet = Sheets("PotentialOrders")
Set table_list_object = the_sheet.ListObjects(1)
Set table_object_row = table_list_object.ListRows.add
table_object_row.Range(1, 1).Value = "0"
table_object_row.Range(1, 3).Value = 'Pick up data from cell "C1" everytime and paste it in Column C (last row)'
table_object_row.Range(1, 6).Value = "Enter Potential Shipping Date"
table_object_row.Range(1, 8).Value = "Select Item No."
table_object_row.Range(1, 9).Value = "Select Packing Type"
table_object_row.Range(1, 10).Value = "Enter Quantity"
table_object_row.Range(1, 11).Value = "Enter Unit Price"
With the_sheet.Cells(the_sheet.Rows.Count, "A").End(xlUp)
.Select ' not required to change the focus/view
ActiveWindow.ScrollRow = .Row
End With
End Sub