+ Reply to Thread
Results 1 to 2 of 2

trying to code this so after a certian time the cell will change colors and also if after.

  1. #1
    Registered User
    Join Date
    06-18-2015
    Location
    New Hampshire
    MS-Off Ver
    2010
    Posts
    10

    trying to code this so after a certian time the cell will change colors and also if after.

    Im trying to make this code that if it is before 11:00 AM the cell color is green if this is after 11:00 AM the cell color is yellow and after 2:00 PM it changes to red and also if its after 5 a message comes up but the cell is still red.. this is what I have so far but it dosnt work.. thank you


    Please Login or Register  to view this content.

  2. #2
    Forum Expert
    Join Date
    01-23-2013
    Location
    USA
    MS-Off Ver
    Microsoft 365 aka Office 365
    Posts
    3,863

    Re: trying to code this so after a certian time the cell will change colors and also if af

    Hi and welcome to ExcelForum,

    Try the following:
    Please Login or Register  to view this content.
    To prevent typos from ruining days and weeks of work 'Option Explicit' is NEEDED at the top of each code module. This prevents errors caused by missspellings and FORCES every variable to be DECLARED (e.g. Dim i as Integer). http://www.cpearson.com/excel/DeclaringVariables.aspx

    Debugger Secrets:
    a. Press 'F8' to single step (goes into subroutines and functions).
    b. Press SHIFT 'F8' to single step OVER subroutines and functions.
    c. Press CTRL 'F8' to stop at the line where the cursor is.
    d. 'Left Click' the margin to the left of a line to set (or clear) a BREAKPOINT.
    e. Press CTRL 'G' to open the IMMEDIATE WINDOW. 'debug.print' statements send their
    output to the IMMEDIATE WINDOW.
    f. Select View > Locals to see all variables while debugging.
    g. To automatically set a BREAKPOINT at a certain location put in the line:
    'Debug.Assert False'
    h. To conditionally set a BREAKPOINT at a certain location put in lines similar to:
    if i >= 20 and xTV20 > 99.56 then
    Debug.Assert False
    endif
    i. A variable value will be displayed by putting the cursor over the variable name.

    Lewis

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. need 6 workbooks to connect an change value of a certian cell in each workbook
    By Jenkins27 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-29-2015, 09:10 PM
  2. [SOLVED] Hide cell if certian cells equal a certian criteria
    By namluke in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 03-22-2014, 09:39 AM
  3. Change all colors of a type with one code
    By rybussell in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-22-2014, 02:32 AM
  4. Change multiple cell colors based on date and time passed
    By cvalentine02 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-12-2013, 12:20 PM
  5. After saving the invoice with new name using VBA code colors and format change
    By poras in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-23-2013, 05:56 AM

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