Import data and macro

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a spreadsheet that uses a web query to gather data. Everyday I
refresh this query and copy and paste the date it imports into another tab.
I do not overwrite the data from previous days. I just copy and paste the
data below the previous days. Is there some way I can have excel do this
automatically? Maybe some kind of macro? Thanks.
 
I do this all the time for myself and clients. Just determine the next
available row in the destination sheet and copy to that

lr=sheets("dest").cells(rows.count,"a").end(xlup).row+1
range("myrange").copy sheets("dest").range("a" & lr)
or
with sheets("dest")
lr=.cells(.rows.count,"a").end(xlup).row+1
range("myrange").copy .range("a" & lr)
end with
 
Don, I am not very familiar with macro's. Is that a formula I should put in
in the destination cell or is that something I need to incorporate into the
macro? Thanks for the help.
 
It is part of a macro. Send me a workbook (to the address below) along with
very detailed instructions as to what you need. Also send snippets of these
posts so I will know where it came from.
 
Don,
Email sent. Thank you very much.

Don Guillett said:
It is part of a macro. Send me a workbook (to the address below) along with
very detailed instructions as to what you need. Also send snippets of these
posts so I will know where it came from.

--
Don Guillett
Microsoft MVP Excel
SalesAid Software
(e-mail address removed)
 
Use this

Sub copyvalues()
dlr = Sheets("Odds").Cells(Rows.Count, "a").End(xlUp).Row + 1
'MsgBox dlr
With Sheets("Pinny")
slr = Application.CountA(.Columns("c")) - 1
'MsgBox slr
..Range(.Cells(1, "o"), .Cells(slr, "q")).Copy
Sheets("Odds").Cells(dlr, 1).PasteSpecial Paste:=xlPasteValues
Application.CutCopyMode = False
End With
End Sub
 
Back
Top