wayneeswif
New Member
- Joined
- Apr 23, 2011
- Messages
- 2
I am hopeful that someone can help me with writing a macro that will compare row headers in Column A between a master worksheet (Year) and another worksheet (1st Qtr) and insert blank rows at each point where a row header is in Year but not in 1st Qtr. There will not be blank rows amongst the row headers before the macro is run. The number of rows to compare varies; the stopping point is the first empty cell in Column A in Year. There will be data in Columns B, etc that needs to be shifted down at the insertion of each blank row. I am using Windows 7, Excel 2010. I have not been able to create a macro that even remotely works and have not been able to find any scenarios that are close of enough to mine to tweak.
An example of the Column A data and what I need is:
<table border="0" cellpadding="0" cellspacing="0" width="437"><col style="width: 27pt;" width="36"> <col style="width: 80pt;" width="106"> <col style="width: 79pt;" width="105"> <col style="width: 143pt;" width="190"> <tbody><tr style="height: 15pt;" height="20"> <td style="height: 15pt; width: 27pt;" align="center" width="36" height="20">
</td> <td class="xl68" style="width: 80pt;" align="center" width="106">1st Qtr (before)</td> <td class="xl68" style="width: 79pt;" align="center" width="105">Year (master)</td> <td class="xl68" style="width: 143pt;" align="center" width="190">1st Qtr (after running macro)</td> </tr> <tr style="height: 15pt;" height="20"> <td class="xl66" style="height: 15pt;" align="center" height="20">Row</td> <td class="xl66" align="center">Column A</td> <td class="xl66" align="center">Column A</td> <td class="xl66" align="center">Column A</td> </tr> <tr style="height: 15pt;" height="20"> <td class="xl67" style="height: 15pt;" align="center" height="20">1</td> <td class="xl67" align="center">AL UI</td> <td class="xl67" align="center">AL UI</td> <td class="xl67" align="center">AL UI</td> </tr> <tr style="height: 15pt;" height="20"> <td class="xl67" style="height: 15pt;" align="center" height="20">2</td> <td class="xl67" align="center">CA UI</td> <td class="xl67" align="center">AZ UI</td> <td class="xl67" align="center">
</td> </tr> <tr style="height: 15pt;" height="20"> <td class="xl67" style="height: 15pt;" align="center" height="20">3</td> <td class="xl67" align="center">CO UI</td> <td class="xl67" align="center">CA UI</td> <td class="xl67" align="center">CA UI</td> </tr> <tr style="height: 15pt;" height="20"> <td class="xl67" style="height: 15pt;" align="center" height="20">4</td> <td class="xl67" align="center">NM UI</td> <td class="xl67" align="center">CO UI</td> <td class="xl67" align="center">CO UI</td> </tr> <tr style="height: 15pt;" height="20"> <td class="xl67" style="height: 15pt;" align="center" height="20">5</td> <td class="xl67" align="center">NV UI</td> <td class="xl67" align="center">IL UI</td> <td class="xl67" align="center">
</td> </tr> <tr style="height: 15pt;" height="20"> <td class="xl67" style="height: 15pt;" align="center" height="20">6</td> <td class="xl67" align="center">
</td> <td class="xl67" align="center">NJ UI</td> <td class="xl67" align="center">
</td> </tr> <tr style="height: 15pt;" height="20"> <td class="xl67" style="height: 15pt;" align="center" height="20">7</td> <td class="xl67" align="center">
</td> <td class="xl67" align="center">NM UI</td> <td class="xl67" align="center">NM UI</td> </tr> <tr style="height: 15pt;" height="20"> <td class="xl67" style="height: 15pt;" align="center" height="20">8</td> <td class="xl67" align="center">
</td> <td class="xl67" align="center">NV UI</td> <td class="xl67" align="center">NV UI</td> </tr> </tbody></table>
An example of the Column A data and what I need is:
<table border="0" cellpadding="0" cellspacing="0" width="437"><col style="width: 27pt;" width="36"> <col style="width: 80pt;" width="106"> <col style="width: 79pt;" width="105"> <col style="width: 143pt;" width="190"> <tbody><tr style="height: 15pt;" height="20"> <td style="height: 15pt; width: 27pt;" align="center" width="36" height="20">
</td> <td class="xl68" style="width: 80pt;" align="center" width="106">1st Qtr (before)</td> <td class="xl68" style="width: 79pt;" align="center" width="105">Year (master)</td> <td class="xl68" style="width: 143pt;" align="center" width="190">1st Qtr (after running macro)</td> </tr> <tr style="height: 15pt;" height="20"> <td class="xl66" style="height: 15pt;" align="center" height="20">Row</td> <td class="xl66" align="center">Column A</td> <td class="xl66" align="center">Column A</td> <td class="xl66" align="center">Column A</td> </tr> <tr style="height: 15pt;" height="20"> <td class="xl67" style="height: 15pt;" align="center" height="20">1</td> <td class="xl67" align="center">AL UI</td> <td class="xl67" align="center">AL UI</td> <td class="xl67" align="center">AL UI</td> </tr> <tr style="height: 15pt;" height="20"> <td class="xl67" style="height: 15pt;" align="center" height="20">2</td> <td class="xl67" align="center">CA UI</td> <td class="xl67" align="center">AZ UI</td> <td class="xl67" align="center">
</td> </tr> <tr style="height: 15pt;" height="20"> <td class="xl67" style="height: 15pt;" align="center" height="20">3</td> <td class="xl67" align="center">CO UI</td> <td class="xl67" align="center">CA UI</td> <td class="xl67" align="center">CA UI</td> </tr> <tr style="height: 15pt;" height="20"> <td class="xl67" style="height: 15pt;" align="center" height="20">4</td> <td class="xl67" align="center">NM UI</td> <td class="xl67" align="center">CO UI</td> <td class="xl67" align="center">CO UI</td> </tr> <tr style="height: 15pt;" height="20"> <td class="xl67" style="height: 15pt;" align="center" height="20">5</td> <td class="xl67" align="center">NV UI</td> <td class="xl67" align="center">IL UI</td> <td class="xl67" align="center">
</td> </tr> <tr style="height: 15pt;" height="20"> <td class="xl67" style="height: 15pt;" align="center" height="20">6</td> <td class="xl67" align="center">
</td> <td class="xl67" align="center">NJ UI</td> <td class="xl67" align="center">
</td> </tr> <tr style="height: 15pt;" height="20"> <td class="xl67" style="height: 15pt;" align="center" height="20">7</td> <td class="xl67" align="center">
</td> <td class="xl67" align="center">NM UI</td> <td class="xl67" align="center">NM UI</td> </tr> <tr style="height: 15pt;" height="20"> <td class="xl67" style="height: 15pt;" align="center" height="20">8</td> <td class="xl67" align="center">
</td> <td class="xl67" align="center">NV UI</td> <td class="xl67" align="center">NV UI</td> </tr> </tbody></table>