In the sample sheet attached I have 2 query files, one immediately follows the other and they are both the same file and contain the same data. I have 2 macros set up to transfer data to sheet2. The HomeCopy macro transfers data from the first query table and the AwayCopy macro transfers data from the second (orange) query table. The code I'm using for the HomeCopy macro is:
Formula:
Sub HomeCopy()
'
' HomeCopy Macro
'
'
Range("A2:U16").Select
Selection.Copy
Sheets("Sheet2").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("A2").Select
End Sub
The issue I'm having is that each query table would be updated weekly and the amount of scores increased so the range in the macro "A2:U16" would no longer applicable. This range is always the total amount of rows in the query table so for example if I added 4 new scores to the query file then the required range would be "A2:U20". Is it possible to set the range as the total amount of rows in the query file so that when it was refreshed each week the macro would pick up the newly added data? I may have explained that badly, not sure.
Thanks in advance for any replies. Sample 14 .xlsm
Bookmarks