+ Reply to Thread
Results 1 to 3 of 3

Format condition

Hybrid View

  1. #1
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,710

    Re: Format condition

    See file Attached
    Worksheet Events are used. Range B1:E6 is used. Can be changed.
    code

    Dim PreValue As Variant
    Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    
    If Not Intersect(Target, Range("B1:C6")) Is Nothing And Target.Cells.Count = 1 Then
    PreValue = Target.Value
    End If
    
    End Sub
    Private Sub Worksheet_Change(ByVal Target As Range)
    
    If Not Intersect(Target, Range("B1:E6")) Is Nothing And Target.Cells.Count = 1 Then
        If PreValue = "" Then
        
        With Target.Interior
            .Pattern = xlSolid
            .PatternColorIndex = xlAutomatic
            .ThemeColor = xlThemeColorAccent3
            .Color = 65535
            .TintAndShade = 0
        End With
        
        ElseIf PreValue <> Target.Value And Target.Value <> "" Then
        
        With Target.Interior
            .Pattern = xlSolid
            .PatternColorIndex = xlAutomatic
            .ThemeColor = xlThemeColorAccent3
            .TintAndShade = 0.599993896298105
            .PatternTintAndShade = 0
        End With
    
        End If
    
    End If
    
    End Sub
    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)

Similar Threads

  1. Condition format
    By mubeenff in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-11-2010, 06:29 AM
  2. Excel 2007 : condition format
    By mubeenff in forum Excel General
    Replies: 1
    Last Post: 12-11-2010, 04:59 AM
  3. multi condition format? lookup and date condition valid for.
    By D_Rennie in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 08-13-2009, 11:37 AM
  4. Condition Format
    By hoachen in forum Excel General
    Replies: 1
    Last Post: 08-12-2009, 01:25 PM
  5. condition format
    By Davycc in forum Excel General
    Replies: 4
    Last Post: 07-09-2009, 07:41 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