Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default Copy and paste new records only

Hello €“
Im not well versed in Excel programming, but will describe what I'm trying
to accomplish.

I have a worksheet (Export Data) with data in columns A through S, Rows 2
through 21389. The data is pulled in from a few other worksheets using
formulas. As it is right now, I have a macro set up that will copy all of the
values from A2 through S21389 and pastes into another spreadsheet, converts
all dates to a specific format and saves as a.txt file within a specific
folder. The issue is however, that this macro will copy everything from A1
through S21389, every time that it is activated. In a perfect world, this
macro would only copy items that have changed since the last time the macro
was run, therefore only exporting new data.

My thought process is as follows, any time new data is carried over within
the Export Data worksheet, anywhere within columns A through S, an X placed
in Column T within the applicable row. The macro would be reset to copy only
rows with an X in Column T. Then, the last step of the macro would clear out
all of the Xs so that only new items will export the next time the macro is
run. Is this possible?

Any advice will be greatly appreciated, Mike

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default Copy and paste new records only

You can accomplish your goal, however, it is very likely that multiple
copy/pastes will actually take longer than a single one:

Sub Macro1()
Dim r1, r2 As Range
Set r1 = Worksheets("Sheet1").Range("A1:S21389")
Set r2 = Worksheets("Sheet2").Range("A1")
r1.Copy r2
End Sub


--
Gary''s Student


"Mike G - D.C." wrote:

Hello €“
Im not well versed in Excel programming, but will describe what I'm trying
to accomplish.

I have a worksheet (Export Data) with data in columns A through S, Rows 2
through 21389. The data is pulled in from a few other worksheets using
formulas. As it is right now, I have a macro set up that will copy all of the
values from A2 through S21389 and pastes into another spreadsheet, converts
all dates to a specific format and saves as a.txt file within a specific
folder. The issue is however, that this macro will copy everything from A1
through S21389, every time that it is activated. In a perfect world, this
macro would only copy items that have changed since the last time the macro
was run, therefore only exporting new data.

My thought process is as follows, any time new data is carried over within
the Export Data worksheet, anywhere within columns A through S, an X placed
in Column T within the applicable row. The macro would be reset to copy only
rows with an X in Column T. Then, the last step of the macro would clear out
all of the Xs so that only new items will export the next time the macro is
run. Is this possible?

Any advice will be greatly appreciated, Mike

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default Copy and paste new records only

Gary's Student -
I really appreciate the quick response. How does the code distinguish from
old data entries and new data entries?
Again, I really appreciate the help and quick response, Mike


"Gary''s Student" wrote:

You can accomplish your goal, however, it is very likely that multiple
copy/pastes will actually take longer than a single one:

Sub Macro1()
Dim r1, r2 As Range
Set r1 = Worksheets("Sheet1").Range("A1:S21389")
Set r2 = Worksheets("Sheet2").Range("A1")
r1.Copy r2
End Sub


--
Gary''s Student


"Mike G - D.C." wrote:

Hello €“
Im not well versed in Excel programming, but will describe what I'm trying
to accomplish.

I have a worksheet (Export Data) with data in columns A through S, Rows 2
through 21389. The data is pulled in from a few other worksheets using
formulas. As it is right now, I have a macro set up that will copy all of the
values from A2 through S21389 and pastes into another spreadsheet, converts
all dates to a specific format and saves as a.txt file within a specific
folder. The issue is however, that this macro will copy everything from A1
through S21389, every time that it is activated. In a perfect world, this
macro would only copy items that have changed since the last time the macro
was run, therefore only exporting new data.

My thought process is as follows, any time new data is carried over within
the Export Data worksheet, anywhere within columns A through S, an X placed
in Column T within the applicable row. The macro would be reset to copy only
rows with an X in Column T. Then, the last step of the macro would clear out
all of the Xs so that only new items will export the next time the macro is
run. Is this possible?

Any advice will be greatly appreciated, Mike

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't Copy and Paste or Paste Special between Excel Workbooks wllee Excel Discussion (Misc queries) 5 April 29th 23 03:43 AM
Paste records that overflow to new column on same page Melissa Excel Discussion (Misc queries) 8 September 19th 08 10:28 PM
help w/ generic copy & paste/paste special routine DavidH[_2_] Excel Programming 5 January 23rd 06 03:58 AM
Excel cut/Paste Problem: Year changes after data is copy and paste Asif Excel Discussion (Misc queries) 2 December 9th 05 05:16 PM
Copy and Paste macro needs to paste to a changing cell reference loulou Excel Programming 0 February 24th 05 10:29 AM


All times are GMT +1. The time now is 02:12 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"