+ Reply to Thread
Results 1 to 7 of 7

VBA date function

  1. #1
    Registered User
    Join Date
    10-14-2010
    Location
    Denmark
    MS-Off Ver
    Excel 2003
    Posts
    3

    VBA date function

    I want to check if a date in a cell is before the current date.
    How can i do that (in VBA code)

    Please Login or Register  to view this content.

  2. #2
    Forum Contributor johnjohns's Avatar
    Join Date
    11-19-2007
    Location
    Dubai, UAE
    MS-Off Ver
    2003 and 2007
    Posts
    526

    Re: VBA date function

    try
    Please Login or Register  to view this content.
    rgds
    johnjohns

  3. #3
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: VBA date function

    Why not just use Conditional Formatting?
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  4. #4
    Registered User
    Join Date
    10-14-2010
    Location
    Denmark
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: VBA date function

    thanks johnjohns
    it works ^^

  5. #5
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: VBA date function

    It will only work if your users enable macros, so Conditional formatting would be the best option & faster

  6. #6
    Forum Contributor johnjohns's Avatar
    Join Date
    11-19-2007
    Location
    Dubai, UAE
    MS-Off Ver
    2003 and 2007
    Posts
    526

    Re: VBA date function

    RoyUK is right. If at all possible, use excel's built in functions. Macros and array formulas should be of second preference always

    rgds

    johnjohns

  7. #7
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: VBA date function

    I wouldn't always go along with that myself... Conditional Formatting is super volatile so on occasion using VBA to control the formats as and when required would be deemed preferable.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1