Results 1 to 3 of 3

IF statement based on CELL fill or no fill

Threaded View

  1. #1
    Registered User
    Join Date
    08-27-2012
    Location
    United States
    MS-Off Ver
    Excel 2003
    Posts
    1

    IF statement based on CELL fill or no fill

    Hello all,

    I’m having a hard time coming up with a specific line of code in my update macro.

    I want an IF statement that is true when the cell has no fill, but false if it has any color fill.

    This is what I have so far:

    If selection.interior.pattern = xlBlank Then
        
        ActiveSheet.Paste
        Sheets("ENTRY").Select
        Range("B6:B8").Select
        Application.CutCopyMode = False
        Selection.ClearContents
        Range("B6").Select
    
        Else
        Sheets("ENTRY").Select
        Application.CutCopyMode = False
        Range("B6").Select
        MsgBox ("Error: Invalid date. Either Holiday or Weekend.")
    
        End If
    Using the current formula, the IF statement is always true even when there is a colored fill in the cell.
    BTW the fill is based on conditional formatting, don't know if that matters or not.

    Any help would be greatly appreciated.

    -Oli
    Last edited by Cutter; 08-27-2012 at 04:09 PM. Reason: Added code tags

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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