+ Reply to Thread
Results 1 to 4 of 4

Today's date minus two

  1. #1
    Registered User
    Join Date
    12-09-2011
    Location
    Indianapolis
    MS-Off Ver
    Excel 2003
    Posts
    2

    Today's date minus two

    I have a spreadsheet where I am trying to program two things:

    The first is I want an expression that displays two days before today's date, here is what I have
    Please Login or Register  to view this content.
    I get an error 'Operator '-' is not defined for types 'Date' and 'Integer'.

    The second thing is I want each column to fill with one of three colors(red, yellow, green) depending on what color is typed in each cell and if it doesn't have one of those colors it should be transparent, here is the code:
    Please Login or Register  to view this content.
    and the error
    [BC30201] Expression expected.

    Any ideas on what I am missing for each one.

  2. #2
    Forum Contributor Marco-Kun's Avatar
    Join Date
    04-14-2009
    Location
    Holland
    MS-Off Ver
    Dutch:2007
    Posts
    298

    Re: Today's date minus two

    Hello mldardy. Welcome to the forum!

    Does this work for you for the first one:

    Please Login or Register  to view this content.
    For the second I added an example sheet. I did it with conditional formatting.
    Whenever you type "Red", "Yellow" or "Green" in those cells, the color changes accordingly.

    The formula for the first question is also in the sheet.

    Marco
    Attached Files Attached Files
    Last edited by Marco-Kun; 12-09-2011 at 06:01 PM.

  3. #3
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Today's date minus two

    Hello mldardy,

    Welcome to the Forum!

    It appears to me that your question, based on the error and code syntax, is for the SQL Server langauge. This forum deals with questions about Visual Basic for Applications for Excel. It is not likely you will receive an answer to your question in this forum for that language.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  4. #4
    Registered User
    Join Date
    12-09-2011
    Location
    Indianapolis
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: Today's date minus two

    Thanks guys or gals, I was able to figure out both problems.

    Thanks

+ 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