Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Can't Copy and Paste or Paste Special between Excel Workbooks | Excel Discussion (Misc queries) | |||
Paste records that overflow to new column on same page | Excel Discussion (Misc queries) | |||
help w/ generic copy & paste/paste special routine | Excel Programming | |||
Excel cut/Paste Problem: Year changes after data is copy and paste | Excel Discussion (Misc queries) | |||
Copy and Paste macro needs to paste to a changing cell reference | Excel Programming |