L
lonnierudd via OfficeKB.com
I am having a difficult time grasping this for some reason. I have a column
of dates from August 2007 to December 2010 (all end of month). These are in
column D from row 5 to row 45. What I need to do is to have a row of values
that is in column E to refresh monthly when an end of month date is put into
another cell, in this case in cell B1. Here's the thing; from the beginning
date until the current month I need it to have the formula E14-$H$4 (the 14
is what it is in July 2008. It was E13 in June, will be E15 in August, etc).
The following month it needs to roll down one month, and it relates to
another table. In this case July 2008 has the previously mentioned formula,
so August equals B10, September 2008 equals B11, October 2008 equal B12, etc.
Next month the formula mentioned above rolls down one month, and September
2008 equals B10, October equals B11, and so one.
Based on what I can find out it seems that a Do Until is the best thing to do,
but I have never been able to get this to work (I'm pretty new to VBA). If
that's not the best thing, then what would be? This is something I'll be
using in a variety of workbooks going forward, so I would REALLY appreciate
any help anyone could give me. Thanks in advance
Frank R.
of dates from August 2007 to December 2010 (all end of month). These are in
column D from row 5 to row 45. What I need to do is to have a row of values
that is in column E to refresh monthly when an end of month date is put into
another cell, in this case in cell B1. Here's the thing; from the beginning
date until the current month I need it to have the formula E14-$H$4 (the 14
is what it is in July 2008. It was E13 in June, will be E15 in August, etc).
The following month it needs to roll down one month, and it relates to
another table. In this case July 2008 has the previously mentioned formula,
so August equals B10, September 2008 equals B11, October 2008 equal B12, etc.
Next month the formula mentioned above rolls down one month, and September
2008 equals B10, October equals B11, and so one.
Based on what I can find out it seems that a Do Until is the best thing to do,
but I have never been able to get this to work (I'm pretty new to VBA). If
that's not the best thing, then what would be? This is something I'll be
using in a variety of workbooks going forward, so I would REALLY appreciate
any help anyone could give me. Thanks in advance
Frank R.