Results 1 to 18 of 18

Without conditional Formatting COLOR in Cell

Threaded View

waqarqrl Without conditional... 07-25-2012, 02:36 PM
wallyeye Re: Without conditional... 07-25-2012, 07:14 PM
waqarqrl Re: Without conditional... 07-26-2012, 12:22 AM
wallyeye Re: Without conditional... 07-26-2012, 12:08 PM
waqarqrl Re: Without conditional... 07-27-2012, 02:44 PM
wallyeye Re: Without conditional... 07-30-2012, 01:01 PM
waqarqrl Re: Without conditional... 08-19-2012, 11:22 AM
wallyeye Re: Without conditional... 08-20-2012, 11:00 AM
waqarqrl Re: Without conditional... 08-20-2012, 12:35 PM
wallyeye Re: Without conditional... 08-22-2012, 02:31 PM
waqarqrl Re: Without conditional... 08-22-2012, 04:13 PM
wallyeye Re: Without conditional... 08-22-2012, 05:10 PM
waqarqrl Re: Without conditional... 08-23-2012, 03:04 AM
waqarqrl Re: Without conditional... 08-24-2012, 12:49 PM
wallyeye Re: Without conditional... 08-24-2012, 01:14 PM
waqarqrl Re: Without conditional... 08-27-2012, 12:23 AM
wallyeye Re: Without conditional... 08-27-2012, 11:31 AM
Cutter Re: Without conditional... 08-27-2012, 08:49 AM
  1. #1
    Forum Contributor
    Join Date
    07-25-2012
    Location
    Pakistan
    MS-Off Ver
    Office 365 for MAC
    Posts
    191

    Without conditional Formatting COLOR in Cell

    Hi All
    This is my post........Hope u people guide me......

    I apply the below code for highlight Rows and coloumn and then apply Conditional Formatting but that code stop the conditional formatting. i think slight change in code enable conditional formatting to run .



    Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    Dim iColor As Integer
    '// Amended routine found on this Web site
    '// Note: Don't use IF you have Conditional
    '// formating that you want to keep!
    
    '// On error resume in case
    '// user selects a range of cells
    On Error Resume Next
    iColor = Target.Interior.ColorIndex
    'Leave On Error ON for Row offset errors
    
    If iColor < 0 Then
    iColor = 36
    Else
    iColor = iColor + 1
    End If
    
    '// Need this test incase Font color is the same
    If iColor = Target.Font.ColorIndex Then iColor = iColor + 1
    
    Cells.FormatConditions.Delete
    
    '// Horizontal color banding
    With Range("A" & Target.Row, Target.Address) 'Rows(Target.Row)
    .FormatConditions.Add Type:=2, Formula1:="TRUE"
    .FormatConditions(1).Interior.ColorIndex = 6
    .FormatConditions(1).Font.Bold = True
    
    
    End With
    
    '// Vertical color banding
    With Range(Target.Offset(1 - Target.Row, 0).Address & ":" & Target.Offset(-1, 0).Address) 'Rows(Target.Row)
    .FormatConditions.Add Type:=2, Formula1:="TRUE"
    .FormatConditions(1).Interior.ColorIndex = 6
    .FormatConditions(1).Font.Bold = True
    
    
    End With
    
    End Sub


    Ragards
    Last edited by Cutter; 07-25-2012 at 10:43 PM. Reason: Added code tags

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