Escanaba
asked on
Excel 2007 Formatting VB Code Needed
Hello,
Hoping some VB code expert can assist on this one. On the attached file you'll see a worksheet called "Raw Format". This is how the Excel report comes in from one of our software providers. I would like a macro that breaks these sections out into individual worksheets represented in the remaining tabs called "How it should appear 1-4" The sheet names are not important so feel free to change them.
The macro should repeat until it identifies text below a cell with the word "Total" in column A. So in the sample provided on the raw format sheet this macro would loop until it identifies text in A70 (just below the text "Total") and would stop. If you think of a better way to end the loop I am open to suggestions.
If someone could please take a look and provide some assistance it would be most helpful.
Thank You!!
EE-Example-July-2014.xlsx
Hoping some VB code expert can assist on this one. On the attached file you'll see a worksheet called "Raw Format". This is how the Excel report comes in from one of our software providers. I would like a macro that breaks these sections out into individual worksheets represented in the remaining tabs called "How it should appear 1-4" The sheet names are not important so feel free to change them.
The macro should repeat until it identifies text below a cell with the word "Total" in column A. So in the sample provided on the raw format sheet this macro would loop until it identifies text in A70 (just below the text "Total") and would stop. If you think of a better way to end the loop I am open to suggestions.
If someone could please take a look and provide some assistance it would be most helpful.
Thank You!!
EE-Example-July-2014.xlsx
ASKER
Glenn - This appears to be working great. My client threw me a curve ball on the data set though. I had requested the unmodified data report and apparently what I received was not the actual report. If you look at the example workbook provided you'll see in cell B2 a form name ( SA Oct 2013 v1 DEV). When the system generates this report the actual raw data has two form reports on the same raw data worksheet. The first one as indicated and the second one has 'DEV' in the text ( SA Oct 2013 v1 DEV). The section with the DEV has the additional text after the 'Total' in column A.
Is it possible to update the code so that it first identifies the form name in B2, breaks everything out as you've provided and stops when it sees the DEV form text in column B, then breaks those additional sections out into individual tabs and stops once it sees the additional text after the 'Total' in column A?
If this requires a great deal of rework I can approve the work submitted and repost so you can make the adjustments. Just let me know. Thanks so much for your assistance on putting this together!
EE-Example-July-2014.xlsx
Is it possible to update the code so that it first identifies the form name in B2, breaks everything out as you've provided and stops when it sees the DEV form text in column B, then breaks those additional sections out into individual tabs and stops once it sees the additional text after the 'Total' in column A?
If this requires a great deal of rework I can approve the work submitted and repost so you can make the adjustments. Just let me know. Thanks so much for your assistance on putting this together!
EE-Example-July-2014.xlsx
So, you'll have two sets of tables, each with the same question number, but one "normal" and one "DEV"?
I thought I was being clever using the question number as a sheet name! If I hadn't done that, you would be able to run this macro on the new data set without any issue. But currently, the four tables in the DEV section have the same question numbers, so their sheets overwrite the first four.
So:
How do you want the new sheets to be named?
For example, they are "Q_3.a", "Q_3.b", and so on. Do you want to see "Q_3.a.DEV" for the new tables or similar?
-Glenn
I thought I was being clever using the question number as a sheet name! If I hadn't done that, you would be able to run this macro on the new data set without any issue. But currently, the four tables in the DEV section have the same question numbers, so their sheets overwrite the first four.
So:
How do you want the new sheets to be named?
For example, they are "Q_3.a", "Q_3.b", and so on. Do you want to see "Q_3.a.DEV" for the new tables or similar?
-Glenn
ASKER
Q_3.a.DEV option would be perfect!
Give me about 15 mins and I'll whip up a modified workbook/macro for you.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Glenn - You are the man! Turned out great and your efforts has created a lot of efficiency and improved quality for the final report. Thanks again! Cheers!
I'm glad I was able to help.
-Glenn
-Glenn
Here's the code:
Open in new window
To run, press [Alt]+[F8] to call up the Macro dialog box then run "Split_Tables_To_Sheets".
Regards,
-Glenn
EE-Example-July-2014.xlsm