ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Exporting data (https://www.excelbanter.com/excel-programming/325663-exporting-data.html)

Jane

Exporting data
 
Hi all,

I am trying to export data through the means of a button placed in excel,
where the macro will copy 2 cells and paste it onto another spreadsheet. This
is not where I need the help, what I am finding difficulty doing is having
the macro not overwrite existing imported data on the other spreasheet.

I want the macro to actually build up a database the another
spreadsheet...if that makes sense. I am aware of the wiazrd template, but I
don't want to take that approach.

Is there a way to give the macro logic in saying if cell x and cell x is
populated then paste data in cell x and cell x, preferably the row below
existing data.

Thanks

Jim Thomlinson[_3_]

Exporting data
 
To shorten up your question are you looking to find the first blank row and
paste your data there? if so then you might be able to do something like

range("A65535").end(xlUp).offset(1,0).select

to select the first blank cell in column A.

HTH

"Jane" wrote:

Hi all,

I am trying to export data through the means of a button placed in excel,
where the macro will copy 2 cells and paste it onto another spreadsheet. This
is not where I need the help, what I am finding difficulty doing is having
the macro not overwrite existing imported data on the other spreasheet.

I want the macro to actually build up a database the another
spreadsheet...if that makes sense. I am aware of the wiazrd template, but I
don't want to take that approach.

Is there a way to give the macro logic in saying if cell x and cell x is
populated then paste data in cell x and cell x, preferably the row below
existing data.

Thanks


Nigel

Exporting data
 
What you need to do is test the range where you wish to write new data, and
find the last row. The following code can be used to get the last row from
a worksheet using the specified column. So in the example lastrow will
contain the last row on the worksheet called "Store" in column A being
empty. All you need to do is refer to the lastrow + 1 as the location to
place your new data.

Dim lastrow As Long
lastrow = Worksheets("Store").Cells(Rows.Count, "A").End(xlUp).Row


--
Cheers
Nigel



"Jane" wrote in message
...
Hi all,

I am trying to export data through the means of a button placed in excel,
where the macro will copy 2 cells and paste it onto another spreadsheet.

This
is not where I need the help, what I am finding difficulty doing is having
the macro not overwrite existing imported data on the other spreasheet.

I want the macro to actually build up a database the another
spreadsheet...if that makes sense. I am aware of the wiazrd template, but

I
don't want to take that approach.

Is there a way to give the macro logic in saying if cell x and cell x is
populated then paste data in cell x and cell x, preferably the row below
existing data.

Thanks





All times are GMT +1. The time now is 04:14 PM.

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