ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   run macro each sheet after and then copy range (https://www.excelbanter.com/excel-programming/426901-run-macro-each-sheet-after-then-copy-range.html)

J.W. Aldridge

run macro each sheet after and then copy range
 
Need to put the following together...


Select each sheet after "Data Sheet".
Run Macro1 on each sheet (this inputs a formula on each sheet).

Copy data range below from each sheet to "data sheet" starting at A10.

Range("A10:G10").Select
Range(Selection, Selection.End(xlDown)).Select


OssieMac

run macro each sheet after and then copy range
 
Need to establish some stuff first. Makes a difference as to how to attack
the problem.

Select each sheet after "Data Sheet". Are there other sheets before Data
Sheet that will be omitted or is Data Sheet the first sheet and all remaining
sheets to be selected? If it is the latter then no problem because Data Sheet
is the only one to omitt but if it is the former then it would be better to
post the names of all the sheets to be omitted otherwise if someone
rearranges the sheets then the code is going to fail.

starting at A10 on Data Sheet. Is there any existing data in the range from
A10 down or will there be at a later time if the code is re-run? (Need to
know whether to delete or overwrite any existing data first.)

Is there anything in A9? (If A9 is never empty and cells below are empty
then makes it easy to append data down from that point but needs to be
handled differently if A9 is empty.)


--
Regards,

OssieMac


"J.W. Aldridge" wrote:

Need to put the following together...


Select each sheet after "Data Sheet".
Run Macro1 on each sheet (this inputs a formula on each sheet).

Copy data range below from each sheet to "data sheet" starting at A10.

Range("A10:G10").Select
Range(Selection, Selection.End(xlDown)).Select




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

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