Error Checking in Excel
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 4 of 4

Thread: Two Questions : Between Times & Excel Versions

  1. #1
    New Member
    Join Date
    Apr 2002
    Posts
    25
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Two quick questions...

    A) A file I am opening updates everyday at noon & the end of the filename is the day of the month it was updated.

    April 26th
    Filename = test26

    I have no problems if the user runs my macro on the 26th because it inserts the day. The problem I am having is if the user runs the macro in the morning of the 27th. 27 inserts at the end of the filename, rather than the 26 that I need.

    How would I code this since I want the day to equal the 26th if it is After 12pm EST on the 26th and before 12pm EST on the 27th.

    B) Is there a way to determine which Excel version the user is running? Users of my programs are running anywhere from version 97 through XP.

    Thanks, Derek_35

  2. #2
    New Member
    Join Date
    Apr 2002
    Posts
    25
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    BUTT

  3. #3
    MrExcel MVP Jay Petrulis's Avatar
    Join Date
    Mar 2002
    Location
    Chicago, IL USA
    Posts
    2,040
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    For your second question,

    test
    Application.Version

    to determine the Excel app running.

    I don't know all the codes, but
    8.0 -- Excel 97
    9.0 -- Excel 2000
    10.0 -- Excel XP

    Use Val(Application.Version) because there are different releases that get different version numbers.

    On my system, Msgbox Application.Version returned 8.0j

    HTH,
    Jay

  4. #4
    MrExcel MVP
    Join Date
    Feb 2002
    Location
    Millbank, London, UK
    Posts
    1,790
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Derek,

    adding to Jay's VBA method, the formula approach would be :

    =INFO("release")

    will will return the "Version of Microsoft Excel, as text."


    :: Pharma Z - Family drugstore ::

Some videos you may like

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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