peternanderson
New Member
- Joined
- Dec 30, 2010
- Messages
- 5
I need to set up a subroutine to make various calculations monthly whose totals then are placed in each year's row.
It appears that Excel 2007 requires Visual Basic to do that, although if there is a simpler way to do that, please let me know that too.
I set up a counter, so I believe that writing the following three lines in VB should get me where I want to go:
<table style="border-collapse: collapse; width: 513pt;" width="682" border="0" cellpadding="0" cellspacing="0"><col style="width: 85pt;" width="113"> <col style="width: 88pt;" width="117"> <col style="width: 85pt;" width="113" span="4"> <tbody><tr style="height: 15pt;" height="20"> <td class="xl65" style="height: 15pt; width: 85pt;" width="113" height="20"> 1 </td> <td class="xl65" colspan="5" style="width: 428pt;" width="569"> If COUNTER>20 and COUNTER<120, Copy Cell Q45 to Relative Cell E [COUNTER] </td> </tr> <tr style="height: 15pt;" height="20"> <td class="xl65" style="height: 15pt;" height="20"> 2 </td> <td class="xl65" colspan="5" style=""> If COUNTER>20 and COUNTER<120, Copy Cell P44 to Relative Cell D [COUNTER] </td> </tr> <tr style="height: 15pt;" height="20"> <td class="xl65" style="height: 15pt;" height="20"> 3 </td> <td class="xl65" colspan="2" style=""> Increment the Counter by 1 </td> <td class="xl65">
</td> <td class="xl65">
</td> <td class="xl65">
</td> </tr> <tr style="height: 15pt;" height="20"> <td class="xl65" style="height: 15pt;" height="20">
</td> <td class="xl65">
</td> <td class="xl65">
</td> <td class="xl65">
</td> <td class="xl65">
</td> <td class="xl65">
</td> </tr> </tbody></table>Any help would be appreciated.
Peter
It appears that Excel 2007 requires Visual Basic to do that, although if there is a simpler way to do that, please let me know that too.
I set up a counter, so I believe that writing the following three lines in VB should get me where I want to go:
<table style="border-collapse: collapse; width: 513pt;" width="682" border="0" cellpadding="0" cellspacing="0"><col style="width: 85pt;" width="113"> <col style="width: 88pt;" width="117"> <col style="width: 85pt;" width="113" span="4"> <tbody><tr style="height: 15pt;" height="20"> <td class="xl65" style="height: 15pt; width: 85pt;" width="113" height="20"> 1 </td> <td class="xl65" colspan="5" style="width: 428pt;" width="569"> If COUNTER>20 and COUNTER<120, Copy Cell Q45 to Relative Cell E [COUNTER] </td> </tr> <tr style="height: 15pt;" height="20"> <td class="xl65" style="height: 15pt;" height="20"> 2 </td> <td class="xl65" colspan="5" style=""> If COUNTER>20 and COUNTER<120, Copy Cell P44 to Relative Cell D [COUNTER] </td> </tr> <tr style="height: 15pt;" height="20"> <td class="xl65" style="height: 15pt;" height="20"> 3 </td> <td class="xl65" colspan="2" style=""> Increment the Counter by 1 </td> <td class="xl65">
</td> <td class="xl65">
</td> <td class="xl65">
</td> </tr> <tr style="height: 15pt;" height="20"> <td class="xl65" style="height: 15pt;" height="20">
</td> <td class="xl65">
</td> <td class="xl65">
</td> <td class="xl65">
</td> <td class="xl65">
</td> <td class="xl65">
</td> </tr> </tbody></table>Any help would be appreciated.
Peter