Results 1 to 3 of 3

Double click to change cell color

Threaded View

  1. #1
    Forum Contributor
    Join Date
    03-06-2014
    Location
    malaysia
    MS-Off Ver
    Excel 2003/2010/2013
    Posts
    107

    Double click to change cell color

    Hey guys,

    Need help here to fix my code.. My objective to double click on cell and cell color will change to GREEN and insert RECEIVED text.
    The problem is, I need to fix my code so make make it work with colored cell also instead WHITE cell only

    EDIT: Colored cell come from conditional formatting. (Maybe this is culprit??)

    Vy0ytIO.png

    Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
        If Not Intersect(Target, Me.Range("D2:O100")) Is Nothing Then
            Cancel = True
            Application.EnableEvents = False
            If Target.Interior.Pattern = xlNone Then '<-------- PROBLEM HERE
                Target.Interior.ColorIndex = 4  'green
                Target.Value2 = "RECEIVED"
            Else
                Target.Interior.Pattern = xlNone
                Target.Value = ""
            End If
        End If
    FallThrough:
        Application.EnableEvents = True
    End Sub
    Last edited by amein; 04-08-2016 at 03:36 AM. Reason: add more info

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Purpose of Operation:=xlNone and modifying values before pasting
    By xyz123 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 10-01-2008, 07:27 AM
  2. [SOLVED] colorindex = xlnone on condition of month of year
    By Jane in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 08-07-2005, 08:05 PM

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