Results 1 to 4 of 4
  1. #1
    3 Star Lounger MacroAlan's Avatar
    Join Date
    Feb 2003
    Location
    St Louis, Missouri, USA
    Posts
    254
    Thanks
    6
    Thanked 1 Time in 1 Post

    Wrong Century Displayed (XP)

    I am sure that there is a setting I am missing. But I have this code:

    <pre>If Month(Now()) >= 4 Then
    [working_Fiscal_Year] = Year(Now()) + 1
    [BudgetFiscal] = Year(Now()) + 2
    Else</pre>



    The Working_Fiscal comes up correctly as 2004 but the BudgetFiscal always shows 1905.

    I checked the year thing in Control Panel. Tried formatting the date differently. Nothing works.

    Suggestions?
    Alan

  2. #2
    WS Lounge VIP sdckapr's Avatar
    Join Date
    Jul 2002
    Location
    Pittsburgh, Pennsylvania, USA
    Posts
    11,225
    Thanks
    14
    Thanked 342 Times in 335 Posts

    Re: Wrong Century Displayed (XP)

    I could NOT duplicate this in XL97 with Win2000.

    When I run the code snippet, the named ranges contain the values 2004 and 2005 respectively.

    I don't see how XL would calculate "Year(Now())" as 2003 one time and as 1903 immediately after? Are you looking in the right cells? do you have any other worksheet_change macros running?
    Steve

  3. #3
    2 Star Lounger
    Join Date
    Feb 2001
    Location
    Brussels, Brussel, Belgium
    Posts
    159
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Wrong Century Displayed (XP)

    check out date settings in configuration panel->international->date->calendar.

    i advise not to use the abbreviated reference to ranges (the square brackets []) as this is a call to an evaluate statement that is not aware of international settings.
    instead, use activeworkbook.sheets(1).range("BudgetFiscal").val ue or something similar (ie. always fully qualify the path to the range)

  4. #4
    Uranium Lounger
    Join Date
    Jan 2001
    Location
    South Carolina, USA
    Posts
    7,295
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Wrong Century Displayed (XP)

    I suspect that you have mispelled the range name, and that BudgetFiscal is a range name pointing to a different cell. Maybe it should be Budget_Fiscal, or Budget_Fiscal_Year?
    Legare Coleman

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •