LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,651
Default Delete single conditional format

Excel 2007 / VBA 6.5

Is it possible to delete a single conditional format? (My goal is to delete
all except 2.

I have tried to do so (code below) and receive a 1004 error.

When recording a macro while deleting two of the formats, it appears to delete
ALL of the formats, and then recreate the formats that remain.

Here is the code I tried:

=============================
Private Sub Worksheet_Activate()
Dim i As Long

With Worksheets("solver").Cells
If .FormatConditions.Count 2 Then
For i = 1 To .FormatConditions.Count - 2
.FormatConditions(i).Delete
Next i
End If
End With
End Sub
===========================
--ron
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
conditional format of entire row based on a single cell in row CEG_Staffer[_2_] Excel Worksheet Functions 7 July 16th 09 10:54 PM
Setting an Icon Set conditional format for a single cell??? MikeV Excel Discussion (Misc queries) 4 February 14th 08 12:20 AM
delete single spaces Mark R Excel Discussion (Misc queries) 5 May 31st 07 05:03 PM
Conditional Format to Delete Row Teresa C Excel Programming 1 October 24th 05 08:27 PM
delete columns with 0 in single row paul mueller Excel Programming 2 April 15th 04 01:42 PM


All times are GMT +1. The time now is 10:45 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"