ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Dates in VBA (https://www.excelbanter.com/excel-discussion-misc-queries/116465-dates-vba.html)

wienmichael

Dates in VBA
 
The dates being returned in my formulas are 4 years and 1 day later. Even
just with the Now function. Why?

Ron Rosenfeld

Dates in VBA
 
On Fri, 27 Oct 2006 13:09:01 -0700, wienmichael
wrote:

The dates being returned in my formulas are 4 years and 1 day later. Even
just with the Now function. Why?


In VBA as in the Subject??

Please post examples.

If you mean in your worksheet, go to Tools/Options/Calculations/Workbook
Options and DEselect 1904 Date system.
--ron

wienmichael

Dates in VBA
 
Thanks for the help.

"Ron Rosenfeld" wrote:

On Fri, 27 Oct 2006 13:09:01 -0700, wienmichael
wrote:

The dates being returned in my formulas are 4 years and 1 day later. Even
just with the Now function. Why?


In VBA as in the Subject??

Please post examples.

If you mean in your worksheet, go to Tools/Options/Calculations/Workbook
Options and DEselect 1904 Date system.
--ron


Gord Dibben

Dates in VBA
 
Check out the Date System you are using in ToolsOptionsCalculation.

Sounds like the 1904 system is checked.

Uncheck it.

Your dates will not change so you will have to subtract 1462 from each.

Enter 1462 in an unused cell.

Copy then select your dates and Paste SpecialSubtractOKEsc.

Re-format the cells to Date as the above operation will change to Number.


Gord Dibben MS Excel MVP

On Fri, 27 Oct 2006 13:09:01 -0700, wienmichael
wrote:

The dates being returned in my formulas are 4 years and 1 day later. Even
just with the Now function. Why?




All times are GMT +1. The time now is 07:00 AM.

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