ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Monthly Update (https://www.excelbanter.com/excel-programming/426841-monthly-update.html)

Richard

Monthly Update
 
Hi

I have created a spreadsheet to monitor monthly income.

Col c col d col e col f col g col h col i
jan feb mar apr YTD qtr 1 qtr 2

While I have found it very easy to update and add a new month, also adding
the ytd formula which in this case sums col c to col f, I hit problems when
automating the entry of the qtr 1, qtr 2 formula.

In Jan the spreadsheet would look something like

Col c col d col e
jan YTD qtr 1

while in Feb

Col c col d col e col f
jan feb YTD qtr 1

thius is bad enough, but when I get to a new quarter, the whole issue
becomes even more complicated.

I would be really grateful if someone could help me get away from the clumsy
and repetative blocks of code, which basically decide which month it is and
either runs or moves on. I really need a clever loop,

Thanks in advance
Richard


joel

Monthly Update
 
The month is simply the column where YTD is minus 3. for example

Jan YTD is in column D = 4
Feb YTD is in column E = 5


So if YTD is in Row 1

set c = rows(1).find(what:="YTD", _
lookin:=xlvalues,lookat:=xlwhole)
MyMonth = c.column - 3

"Richard" wrote:

Hi

I have created a spreadsheet to monitor monthly income.

Col c col d col e col f col g col h col i
jan feb mar apr YTD qtr 1 qtr 2

While I have found it very easy to update and add a new month, also adding
the ytd formula which in this case sums col c to col f, I hit problems when
automating the entry of the qtr 1, qtr 2 formula.

In Jan the spreadsheet would look something like

Col c col d col e
jan YTD qtr 1

while in Feb

Col c col d col e col f
jan feb YTD qtr 1

thius is bad enough, but when I get to a new quarter, the whole issue
becomes even more complicated.

I would be really grateful if someone could help me get away from the clumsy
and repetative blocks of code, which basically decide which month it is and
either runs or moves on. I really need a clever loop,

Thanks in advance
Richard



All times are GMT +1. The time now is 07:25 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com