r.baldwin7960
New Member
- Joined
- Jun 25, 2008
- Messages
- 29
Thank you in advance for any help I might recieve.
I have a web query that pulls a table of sales associates and their performance metrics. The table only contains the associates whom have metrics from the previous day. So the list is not always the same. I then need to copy that data to the "Sort Page" sheet. This way I can sort the associates out against a master list in order to use the VLOOKUP to create reports on the "Main" sheet.
My problem is this:
Because the number of associates changes on the table, I am constantly having to modify the macro to copy only the cells needed. (Otherwise the Sorting macro I use does not work properly)
What I need is a way to only copy data from the "Query" page from the starting point to the row right above the cell containing "Grand Totals". The columns are usually static, only the rows change.
Code:
Sub DataCopy()
Application.ScreenUpdating = False
Sheets("Sort Sheet").Select
Columns("C:CI").Select
Selection.ClearContents
Range("C1").Select
ActiveCell.FormulaR1C1 = "='Query Page'!R[6]C[-2]"
Range("C1").Select
Selection.AutoFill Destination:=Range("C1:C312"), Type:=xlFillDefault
Range("C1:C312").Select
Selection.AutoFill Destination:=Range("C1:CI312"), Type:=xlFillDefault
Sheets("Main Sheet").Select
Application.ScreenUpdating = True
End Sub
I have a web query that pulls a table of sales associates and their performance metrics. The table only contains the associates whom have metrics from the previous day. So the list is not always the same. I then need to copy that data to the "Sort Page" sheet. This way I can sort the associates out against a master list in order to use the VLOOKUP to create reports on the "Main" sheet.
My problem is this:
Because the number of associates changes on the table, I am constantly having to modify the macro to copy only the cells needed. (Otherwise the Sorting macro I use does not work properly)
What I need is a way to only copy data from the "Query" page from the starting point to the row right above the cell containing "Grand Totals". The columns are usually static, only the rows change.