excelsishya
Board Regular
- Joined
- Jul 25, 2010
- Messages
- 107
Hi Guys,
I am looking for VBA code for combine sheet variant.
If Workbook as multiple Tabs, and in group mode if i select say 7 rows 4 columns , in first tab, i want all tabs 7 rows 4 columns combined in new master sheet below one another and with respective tab name in one of blank Right column in master sheet. Please see sample below for what i am looking for.
Thanks
Tab 1(BS2009)
<table width="309" border="0" cellpadding="0" cellspacing="0"><col style="width: 77pt;" width="103"> <col style="width: 59pt;" width="78"> <col style="width: 48pt;" width="64" span="2"> <tbody><tr style="height: 15pt;" height="20"> <td style="height: 15pt; width: 77pt;" width="103" height="20">BALANCE SHEET</td> <td style="width: 59pt;" width="78">
</td> <td style="width: 48pt;" width="64">
</td> <td style="width: 48pt;" width="64">
</td> </tr> <tr style="height: 15pt;" height="20"> <td style="height: 15pt;" height="20">
</td> <td>
</td> <td>
</td> <td>
</td> </tr> <tr style="height: 15pt;" height="20"> <td style="height: 15pt;" height="20">
</td> <td>Description</td> <td>code</td> <td>amount</td> </tr> <tr style="height: 15pt;" height="20"> <td style="height: 15pt;" height="20">
</td> <td>A</td> <td align="right">1</td> <td align="right">500</td> </tr> <tr style="height: 15pt;" height="20"> <td style="height: 15pt;" height="20">
</td> <td>A</td> <td align="right">1</td> <td align="right">802</td> </tr> <tr style="height: 15pt;" height="20"> <td style="height: 15pt;" height="20">
</td> <td>A</td> <td align="right">1</td> <td align="right">2581</td> </tr> <tr style="height: 15pt;" height="20"> <td style="height: 15pt;" height="20">
</td> <td>A</td> <td align="right">1</td> <td align="right">2963</td> </tr> </tbody></table>TAB2(BS2010)
<table width="295" border="0" cellpadding="0" cellspacing="0"><col style="width: 77pt;" width="103"> <col style="width: 48pt;" width="64" span="3"> <tbody><tr style="height: 15pt;" height="20"> <td style="height: 15pt; width: 77pt;" width="103" height="20">
</td> <td style="width: 48pt;" width="64">
</td> <td style="width: 48pt;" width="64">
</td> <td style="width: 48pt;" width="64">
</td> </tr> <tr style="height: 15pt;" height="20"> <td style="height: 15pt;" height="20">
</td> <td>
</td> <td>
</td> <td>
</td> </tr> <tr style="height: 15pt;" height="20"> <td style="height: 15pt;" height="20">
</td> <td>Description</td> <td>code</td> <td>amount</td> </tr> <tr style="height: 15pt;" height="20"> <td style="height: 15pt;" height="20">
</td> <td>B</td> <td align="right">2</td> <td align="right">1000</td> </tr> <tr style="height: 15pt;" height="20"> <td style="height: 15pt;" height="20">
</td> <td>C</td> <td align="right">3</td> <td align="right">1000</td> </tr> <tr style="height: 15pt;" height="20"> <td style="height: 15pt;" height="20">
</td> <td>C</td> <td align="right">3</td> <td align="right">1000</td> </tr> <tr style="height: 15pt;" height="20"> <td style="height: 15pt;" height="20">
</td> <td>C</td> <td align="right">3</td> <td align="right">1000</td> </tr> </tbody></table>COMBINED SHEET TAB OUTPUT DESIRED
<table width="384" border="0" cellpadding="0" cellspacing="0"><col style="width: 48pt;" width="64" span="6"> <tbody><tr style="height: 15pt;" height="20"> <td colspan="2" style="height: 15pt; width: 96pt;" width="128" height="20">BALANCE SHEET</td> <td style="width: 48pt;" width="64">
</td> <td style="width: 48pt;" width="64">
</td> <td style="width: 48pt;" width="64">
</td> <td style="width: 48pt;" width="64">2009BS</td> </tr> <tr style="height: 15pt;" height="20"> <td style="height: 15pt;" height="20">
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>2009BS</td> </tr> <tr style="height: 15pt;" height="20"> <td style="height: 15pt;" height="20">
</td> <td>Description</td> <td>code</td> <td>amount</td> <td>
</td> <td>2009BS</td> </tr> <tr style="height: 15pt;" height="20"> <td style="height: 15pt;" height="20">
</td> <td>A</td> <td align="right">1</td> <td align="right">500</td> <td>
</td> <td>2009BS</td> </tr> <tr style="height: 15pt;" height="20"> <td style="height: 15pt;" height="20">
</td> <td>A</td> <td align="right">1</td> <td align="right">802</td> <td>
</td> <td>2009BS</td> </tr> <tr style="height: 15pt;" height="20"> <td style="height: 15pt;" height="20">
</td> <td>A</td> <td align="right">1</td> <td align="right">2581</td> <td>
</td> <td>2009BS</td> </tr> <tr style="height: 15pt;" height="20"> <td style="height: 15pt;" height="20">
</td> <td>A</td> <td align="right">1</td> <td align="right">2963</td> <td>
</td> <td>2009BS</td> </tr> <tr style="height: 15pt;" height="20"> <td style="height: 15pt;" height="20">
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>2010BS</td> </tr> <tr style="height: 15pt;" height="20"> <td style="height: 15pt;" height="20">
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>2010BS</td> </tr> <tr style="height: 15pt;" height="20"> <td style="height: 15pt;" height="20">
</td> <td>Description</td> <td>code</td> <td>amount</td> <td>
</td> <td>2010BS</td> </tr> <tr style="height: 15pt;" height="20"> <td style="height: 15pt;" height="20">
</td> <td>B</td> <td align="right">2</td> <td align="right">1000</td> <td>
</td> <td>2010BS</td> </tr> <tr style="height: 15pt;" height="20"> <td style="height: 15pt;" height="20">
</td> <td>C</td> <td align="right">3</td> <td align="right">1000</td> <td>
</td> <td>2010BS</td> </tr> <tr style="height: 15pt;" height="20"> <td style="height: 15pt;" height="20">
</td> <td>C</td> <td align="right">3</td> <td align="right">1000</td> <td>
</td> <td>2010BS</td> </tr> <tr style="height: 15pt;" height="20"> <td style="height: 15pt;" height="20">
</td> <td>C</td> <td align="right">3</td> <td align="right">1000</td> <td>
</td> <td>2010BS</td> </tr> </tbody></table>
<table width="309" border="0" cellpadding="0" cellspacing="0"><col style="width: 77pt;" width="103"> <col style="width: 59pt;" width="78"> <col style="width: 48pt;" width="64" span="2"> <tbody><tr style="height: 15pt;" height="20"> <td style="width: 59pt;" width="78">
</td><td style="width: 48pt;" width="64">
</td><td style="width: 48pt;" width="64">
</td></tr><tr style="height: 15pt;" height="20"><td>
</td><td>
</td><td>
</td></tr><tr style="height: 15pt;" height="20"><td>
</td><td>
</td><td>
</td></tr><tr style="height: 15pt;" height="20"><td>
</td><td align="right">
</td><td align="right">
</td></tr><tr style="height: 15pt;" height="20"><td>
</td><td align="right">
</td><td align="right">
</td></tr><tr style="height: 15pt;" height="20"><td>
</td><td align="right">
</td><td align="right">
</td></tr><tr style="height: 15pt;" height="20"><td>
</td><td align="right">
</td><td align="right">
</td></tr><tr style="height: 15pt;" height="20"><td>
</td><td align="right">
</td><td align="right">
</td></tr><tr style="height: 15pt;" height="20"><td>
</td><td align="right">
</td><td align="right">
</td></tr><tr style="height: 15pt;" height="20"><td>
</td><td align="right">
</td><td align="right">
</td></tr><tr style="height: 15pt;" height="20"><td>
</td><td align="right">
</td><td align="right">
</td></tr><tr style="height: 15pt;" height="20"><td>
</td><td align="right">
</td><td align="right">
</td></tr><tr style="height: 15pt;" height="20"><td>
</td><td align="right">
</td><td align="right">
</td></tr><tr style="height: 15pt;" height="20"><td>
</td><td align="right">
</td><td align="right">
</td></tr><tr style="height: 15pt;" height="20"><td>
</td><td align="right">
</td><td align="right">
</td></tr><tr style="height: 15pt;" height="20"><td>
</td><td align="right">
</td><td align="right">
</td></tr><tr style="height: 15pt;" height="20"><td>
</td><td align="right">
</td><td align="right">
</td></tr><tr style="height: 15pt;" height="20"><td>
</td><td align="right">
</td><td align="right">
</td></tr><tr style="height: 15pt;" height="20"><td>
</td><td>
</td><td>
</td></tr><tr style="height: 15pt;" height="20"><td>
</td><td>
</td><td>
</td></tr><tr style="height: 15pt;" height="20"><td>
</td><td>
</td><td>
</td></tr><tr style="height: 15pt;" height="20"><td>
</td><td>
</td><td>
</td></tr><tr style="height: 15pt;" height="20"><td>
</td><td>
</td><td>
</td></tr><tr style="height: 15pt;" height="20"><td>
</td><td>
</td><td>
</td></tr><tr style="height: 15pt;" height="20"><td>
</td><td>
</td><td>
</td></tr></tbody></table>
I am looking for VBA code for combine sheet variant.
If Workbook as multiple Tabs, and in group mode if i select say 7 rows 4 columns , in first tab, i want all tabs 7 rows 4 columns combined in new master sheet below one another and with respective tab name in one of blank Right column in master sheet. Please see sample below for what i am looking for.
Thanks
Tab 1(BS2009)
<table width="309" border="0" cellpadding="0" cellspacing="0"><col style="width: 77pt;" width="103"> <col style="width: 59pt;" width="78"> <col style="width: 48pt;" width="64" span="2"> <tbody><tr style="height: 15pt;" height="20"> <td style="height: 15pt; width: 77pt;" width="103" height="20">BALANCE SHEET</td> <td style="width: 59pt;" width="78">
</td> <td style="width: 48pt;" width="64">
</td> <td style="width: 48pt;" width="64">
</td> </tr> <tr style="height: 15pt;" height="20"> <td style="height: 15pt;" height="20">
</td> <td>
</td> <td>
</td> <td>
</td> </tr> <tr style="height: 15pt;" height="20"> <td style="height: 15pt;" height="20">
</td> <td>Description</td> <td>code</td> <td>amount</td> </tr> <tr style="height: 15pt;" height="20"> <td style="height: 15pt;" height="20">
</td> <td>A</td> <td align="right">1</td> <td align="right">500</td> </tr> <tr style="height: 15pt;" height="20"> <td style="height: 15pt;" height="20">
</td> <td>A</td> <td align="right">1</td> <td align="right">802</td> </tr> <tr style="height: 15pt;" height="20"> <td style="height: 15pt;" height="20">
</td> <td>A</td> <td align="right">1</td> <td align="right">2581</td> </tr> <tr style="height: 15pt;" height="20"> <td style="height: 15pt;" height="20">
</td> <td>A</td> <td align="right">1</td> <td align="right">2963</td> </tr> </tbody></table>TAB2(BS2010)
<table width="295" border="0" cellpadding="0" cellspacing="0"><col style="width: 77pt;" width="103"> <col style="width: 48pt;" width="64" span="3"> <tbody><tr style="height: 15pt;" height="20"> <td style="height: 15pt; width: 77pt;" width="103" height="20">
</td> <td style="width: 48pt;" width="64">
</td> <td style="width: 48pt;" width="64">
</td> <td style="width: 48pt;" width="64">
</td> </tr> <tr style="height: 15pt;" height="20"> <td style="height: 15pt;" height="20">
</td> <td>
</td> <td>
</td> <td>
</td> </tr> <tr style="height: 15pt;" height="20"> <td style="height: 15pt;" height="20">
</td> <td>Description</td> <td>code</td> <td>amount</td> </tr> <tr style="height: 15pt;" height="20"> <td style="height: 15pt;" height="20">
</td> <td>B</td> <td align="right">2</td> <td align="right">1000</td> </tr> <tr style="height: 15pt;" height="20"> <td style="height: 15pt;" height="20">
</td> <td>C</td> <td align="right">3</td> <td align="right">1000</td> </tr> <tr style="height: 15pt;" height="20"> <td style="height: 15pt;" height="20">
</td> <td>C</td> <td align="right">3</td> <td align="right">1000</td> </tr> <tr style="height: 15pt;" height="20"> <td style="height: 15pt;" height="20">
</td> <td>C</td> <td align="right">3</td> <td align="right">1000</td> </tr> </tbody></table>COMBINED SHEET TAB OUTPUT DESIRED
<table width="384" border="0" cellpadding="0" cellspacing="0"><col style="width: 48pt;" width="64" span="6"> <tbody><tr style="height: 15pt;" height="20"> <td colspan="2" style="height: 15pt; width: 96pt;" width="128" height="20">BALANCE SHEET</td> <td style="width: 48pt;" width="64">
</td> <td style="width: 48pt;" width="64">
</td> <td style="width: 48pt;" width="64">
</td> <td style="width: 48pt;" width="64">2009BS</td> </tr> <tr style="height: 15pt;" height="20"> <td style="height: 15pt;" height="20">
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>2009BS</td> </tr> <tr style="height: 15pt;" height="20"> <td style="height: 15pt;" height="20">
</td> <td>Description</td> <td>code</td> <td>amount</td> <td>
</td> <td>2009BS</td> </tr> <tr style="height: 15pt;" height="20"> <td style="height: 15pt;" height="20">
</td> <td>A</td> <td align="right">1</td> <td align="right">500</td> <td>
</td> <td>2009BS</td> </tr> <tr style="height: 15pt;" height="20"> <td style="height: 15pt;" height="20">
</td> <td>A</td> <td align="right">1</td> <td align="right">802</td> <td>
</td> <td>2009BS</td> </tr> <tr style="height: 15pt;" height="20"> <td style="height: 15pt;" height="20">
</td> <td>A</td> <td align="right">1</td> <td align="right">2581</td> <td>
</td> <td>2009BS</td> </tr> <tr style="height: 15pt;" height="20"> <td style="height: 15pt;" height="20">
</td> <td>A</td> <td align="right">1</td> <td align="right">2963</td> <td>
</td> <td>2009BS</td> </tr> <tr style="height: 15pt;" height="20"> <td style="height: 15pt;" height="20">
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>2010BS</td> </tr> <tr style="height: 15pt;" height="20"> <td style="height: 15pt;" height="20">
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>2010BS</td> </tr> <tr style="height: 15pt;" height="20"> <td style="height: 15pt;" height="20">
</td> <td>Description</td> <td>code</td> <td>amount</td> <td>
</td> <td>2010BS</td> </tr> <tr style="height: 15pt;" height="20"> <td style="height: 15pt;" height="20">
</td> <td>B</td> <td align="right">2</td> <td align="right">1000</td> <td>
</td> <td>2010BS</td> </tr> <tr style="height: 15pt;" height="20"> <td style="height: 15pt;" height="20">
</td> <td>C</td> <td align="right">3</td> <td align="right">1000</td> <td>
</td> <td>2010BS</td> </tr> <tr style="height: 15pt;" height="20"> <td style="height: 15pt;" height="20">
</td> <td>C</td> <td align="right">3</td> <td align="right">1000</td> <td>
</td> <td>2010BS</td> </tr> <tr style="height: 15pt;" height="20"> <td style="height: 15pt;" height="20">
</td> <td>C</td> <td align="right">3</td> <td align="right">1000</td> <td>
</td> <td>2010BS</td> </tr> </tbody></table>
<table width="309" border="0" cellpadding="0" cellspacing="0"><col style="width: 77pt;" width="103"> <col style="width: 59pt;" width="78"> <col style="width: 48pt;" width="64" span="2"> <tbody><tr style="height: 15pt;" height="20"> <td style="width: 59pt;" width="78">
</td><td style="width: 48pt;" width="64">
</td><td style="width: 48pt;" width="64">
</td></tr><tr style="height: 15pt;" height="20"><td>
</td><td>
</td><td>
</td></tr><tr style="height: 15pt;" height="20"><td>
</td><td>
</td><td>
</td></tr><tr style="height: 15pt;" height="20"><td>
</td><td align="right">
</td><td align="right">
</td></tr><tr style="height: 15pt;" height="20"><td>
</td><td align="right">
</td><td align="right">
</td></tr><tr style="height: 15pt;" height="20"><td>
</td><td align="right">
</td><td align="right">
</td></tr><tr style="height: 15pt;" height="20"><td>
</td><td align="right">
</td><td align="right">
</td></tr><tr style="height: 15pt;" height="20"><td>
</td><td align="right">
</td><td align="right">
</td></tr><tr style="height: 15pt;" height="20"><td>
</td><td align="right">
</td><td align="right">
</td></tr><tr style="height: 15pt;" height="20"><td>
</td><td align="right">
</td><td align="right">
</td></tr><tr style="height: 15pt;" height="20"><td>
</td><td align="right">
</td><td align="right">
</td></tr><tr style="height: 15pt;" height="20"><td>
</td><td align="right">
</td><td align="right">
</td></tr><tr style="height: 15pt;" height="20"><td>
</td><td align="right">
</td><td align="right">
</td></tr><tr style="height: 15pt;" height="20"><td>
</td><td align="right">
</td><td align="right">
</td></tr><tr style="height: 15pt;" height="20"><td>
</td><td align="right">
</td><td align="right">
</td></tr><tr style="height: 15pt;" height="20"><td>
</td><td align="right">
</td><td align="right">
</td></tr><tr style="height: 15pt;" height="20"><td>
</td><td align="right">
</td><td align="right">
</td></tr><tr style="height: 15pt;" height="20"><td>
</td><td align="right">
</td><td align="right">
</td></tr><tr style="height: 15pt;" height="20"><td>
</td><td>
</td><td>
</td></tr><tr style="height: 15pt;" height="20"><td>
</td><td>
</td><td>
</td></tr><tr style="height: 15pt;" height="20"><td>
</td><td>
</td><td>
</td></tr><tr style="height: 15pt;" height="20"><td>
</td><td>
</td><td>
</td></tr><tr style="height: 15pt;" height="20"><td>
</td><td>
</td><td>
</td></tr><tr style="height: 15pt;" height="20"><td>
</td><td>
</td><td>
</td></tr><tr style="height: 15pt;" height="20"><td>
</td><td>
</td><td>
</td></tr></tbody></table>