+ Reply to Thread
Results 1 to 2 of 2

Confusing Variable Types

  1. #1
    Registered User
    Join Date
    06-07-2011
    Location
    Raleigh, Nc
    MS-Off Ver
    Excel 2007
    Posts
    11

    Confusing Variable Types

    I have written some code (below) that will search through specific cells that contain dates formatted at DD-MM-YYYY and will highlight that cell and the two cells above it if the date represented is before the current date. There is an if statement that checks to see if the years are the same and if one of the days is greater than the other. for example, if today is the 28th, and the day value from the cell is 27, then that day is passed and the cells get highlighted Everything works fine, until there is a date in one of those cells whose month is 10 (october), 11(november) or december (12). . i am thinking it has something to do with the way i check the dates (string functions to pull out the different values).

    the part in the code where i believe the problem lies is in bold. the problem is that one value might be 6, and the other 10 but when excel checks to see if 6 is greater than 10, it accepts that as true and continues on, even though that is clearly false.

    thanks in advance for the help

    Please Login or Register  to view this content.

  2. #2
    Registered User
    Join Date
    06-07-2011
    Location
    Raleigh, Nc
    MS-Off Ver
    Excel 2007
    Posts
    11

    Re: Confusing Variable Types

    Attached is a copy of the Excel Sheet
    Attached Files Attached Files

+ 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