ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Days360 Formula in VBA error (https://www.excelbanter.com/excel-programming/407331-days360-formula-vba-error.html)

Brian A

Days360 Formula in VBA error
 
I need to write a macro which looks at a column of dates, takes the Minimum
date (earliest) and the maximum date(latest) and figure out how many weeks
have passed between the two. I recorded a macro, but that limits me by
forcing me to select the exact cells. It is fine on one set of data but I
need to use this over and over with a variable number of data rows. Any
suggestions?

Niek Otten

Days360 Formula in VBA error
 
No macro needed

With the dates in Column B:

=(MAX(B:B)-MIN(B:B))/7

Decide how you'd like to round

--
Kind regards,

Niek Otten
Microsoft MVP - Excel

"Brian A" wrote in message ...
|I need to write a macro which looks at a column of dates, takes the Minimum
| date (earliest) and the maximum date(latest) and figure out how many weeks
| have passed between the two. I recorded a macro, but that limits me by
| forcing me to select the exact cells. It is fine on one set of data but I
| need to use this over and over with a variable number of data rows. Any
| suggestions?




All times are GMT +1. The time now is 11:15 AM.

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