tonywatsonhelp
Well-known Member
- Joined
- Feb 24, 2014
- Messages
- 3,210
- Office Version
- 365
- 2019
- 2016
- Platform
- Windows
Hi everyone,
I have two Excel sheets, one is my working doc that will hold the macro and can be called This workbook,
and Another, I won't know this document's name but it will be the only other Excel document open.
I need to pull all my employee's sales and commission details from this other sheet into This workbook so I can calculate their sales etc. but when we download our accountant's system is very old and the only report he can give us also has loads of other data and wording to it which I need to get rid of.
I've looked at these reports and the only consistency I can find is the data I want always has the header "No" before it in column A and when it ends it always has "Sub Total" in column O,
so I was thinking if I could get a macro that could find each instance of "No" and copy that data down to "Subtotal" and paste it into This document sheet "Data" I could clean it up and use it from there, but I don't know how to get it to work multiple times, and I won't know if its once or 50+ times as each report will be for a different number of days.
If you can help that would be great, Heres a breif of what I need:
I need a macro that when run can do the following,
First check that the only Excel documents open are the one the macro is being run from, my personal workbook (If there is one), and one other sheet,
Now here the big problem,
I don't know what that sheet will be called but it will always be an XLS doc
so with other Excel doc goto active sheet and look down column A, each time it finds a cell that contains "No" as the only word in it, look down column O and find the word "subtotal" and copy everything in the rows from "On" to "SubTotal" columns A to Z and paste in this in workbook sheet "Data" column A and last row, now there will possibly be more than one time this happens so I need the macro to get all of them.
please help if you can
Thanks
Tony
I have two Excel sheets, one is my working doc that will hold the macro and can be called This workbook,
and Another, I won't know this document's name but it will be the only other Excel document open.
I need to pull all my employee's sales and commission details from this other sheet into This workbook so I can calculate their sales etc. but when we download our accountant's system is very old and the only report he can give us also has loads of other data and wording to it which I need to get rid of.
I've looked at these reports and the only consistency I can find is the data I want always has the header "No" before it in column A and when it ends it always has "Sub Total" in column O,
so I was thinking if I could get a macro that could find each instance of "No" and copy that data down to "Subtotal" and paste it into This document sheet "Data" I could clean it up and use it from there, but I don't know how to get it to work multiple times, and I won't know if its once or 50+ times as each report will be for a different number of days.
If you can help that would be great, Heres a breif of what I need:
I need a macro that when run can do the following,
First check that the only Excel documents open are the one the macro is being run from, my personal workbook (If there is one), and one other sheet,
Now here the big problem,
I don't know what that sheet will be called but it will always be an XLS doc
so with other Excel doc goto active sheet and look down column A, each time it finds a cell that contains "No" as the only word in it, look down column O and find the word "subtotal" and copy everything in the rows from "On" to "SubTotal" columns A to Z and paste in this in workbook sheet "Data" column A and last row, now there will possibly be more than one time this happens so I need the macro to get all of them.
please help if you can
Thanks
Tony