ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Import data and macro (https://www.excelbanter.com/excel-discussion-misc-queries/163140-import-data-macro.html)

Jambruins

Import data and macro
 
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.

Don Guillett

Import data and macro
 

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 Guillett
Microsoft MVP Excel
SalesAid Software

"Jambruins" wrote in message
...
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.



Jambruins

Import data and macro
 
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.

"Don Guillett" wrote:


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 Guillett
Microsoft MVP Excel
SalesAid Software

"Jambruins" wrote in message
...
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.




Don Guillett

Import data and macro
 
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

"Jambruins" wrote in message
...
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.

"Don Guillett" wrote:


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 Guillett
Microsoft MVP Excel
SalesAid Software

"Jambruins" wrote in message
...
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.





Jambruins

Import data and macro
 
Don,
Email sent. Thank you very much.

"Don Guillett" wrote:

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

"Jambruins" wrote in message
...
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.

"Don Guillett" wrote:


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 Guillett
Microsoft MVP Excel
SalesAid Software

"Jambruins" wrote in message
...
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.





Don Guillett

Import data and macro
 
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

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Jambruins" wrote in message
...
Don,
Email sent. Thank you very much.

"Don Guillett" wrote:

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

"Jambruins" wrote in message
...
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.

"Don Guillett" wrote:


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 Guillett
Microsoft MVP Excel
SalesAid Software

"Jambruins" wrote in message
...
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.







All times are GMT +1. The time now is 12:57 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com