Macros to tranfer data to database

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

Guest

I am using a macro to transfer data from and input sheet to a database use
cutting and pasteing. I am not sure how to add new data without erase the
data sent during the previous macro execution. Any help will be valued.
 
Is there a column that always has data in it in your database?

I'm gonna use column A for my example:

Dim RngToCopy as range
dim DestCell as range

with worksheets("sheet1")
set rngtocopy = .range("a5:G99") 'some range
end with

with worksheets("sheet2")
set destcell = .cells(.rows.count,"A").end(xlup).offset(1,0)
end with

rngtocopy.copy _
destination:=destcell

====
It starts at A65536, comes up until it finds something, then drops down one row.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top