View Single Post
 
Old 09-19-2018, 11:40 PM
Josh1012 Josh1012 is offline Windows 10 Office 2010 64bit
Novice
 
Join Date: Sep 2018
Posts: 12
Josh1012 is on a distinguished road
Default This is what I have come up with

So I haven't quite found out how to do this yet, but I've got something to get started with. I'm thinking of a long winded method of using 10 "IF" statements with an else statement which deletes all rows and columns if the very last column is filled. Here's an example of what I've got so far, but it doesn't include all 10 IF statements as they just repeat themselves.


Code:
Sub CopyInputData()
Dim table As ListObject, text As String


text = "Data 1"
Set table = ThisWorksheet.ListObjects("Table9")


'So this will copy all my data to the second column of my table as long as it's empty

With table.DataBodyRange
If table.DataBodyRange(, 2) = " " Then
text.Copy Destination:=ThisWorksheet.Cells(25,2)
Sheets("GerotorSelection").Range("C2:C4").Copy
table.DataBodyRange(1, 2).PasteSpecial Paste:=xlPasteValues
Sheets("GerotorSelection").Range("E2:E4").Copy
table.DataBodyRange(4, 2).PasteSpecial Paste:=xlPasteValues
Sheets("GerotorSelection").Range("E13:E16").Copy
table.DataBodyRange(7, 2).PasteSpecial Paste:=xlPasteValues
Reply With Quote