Forum Discussion
Gebhi
Mar 10, 2021Copper Contributor
How would you make an input table?
Hello! I am working on a problem where I need to put a line of data from an input table to put at the end of another table, with supposed infinite length, and would then delete the table input from b...
HansVogelaar
Mar 10, 2021MVP
Create a macro like the following. Replace TABLE and INPUT with the actual names of your tables.
Sub MoveRow()
Dim tbl1 As ListObject
Dim tbl2 As ListObject
Set tbl1 = ActiveSheet.ListObjects("TABLE")
Set tbl2 = ActiveSheet.ListObjects("INPUT")
tbl2.ListRows(1).Range.Cut Destination:=tbl1.ListRows.Add.Range
Application.CutCopyMode = False
End Sub
You can create a command button on the sheet and assign the MoveRow macro to it, or assign a custom keyboard shortcut (or both)
Gebhi
Mar 10, 2021Copper Contributor
I tried that out and I got it working, but I need the data to go just below my previous data, not all the way at the bottom, apologies, as I am not sure about the notation, as I am still learning
- HansVogelaarMar 10, 2021MVP
Do you mean that your table has lots of empty rows?
- GebhiMar 10, 2021Copper ContributorI just realized what you did! That is so intuitive! I figured it out! Thank you so much!