ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Removing conditional formatting if it exists (https://www.excelbanter.com/excel-programming/304935-removing-conditional-formatting-if-exists.html)

Shaun Allan

Removing conditional formatting if it exists
 
On a group of spreadsheets, on the sheet names "Single",
column N sometimes has conditional formatting (2
conditions) that shouldn't be there. How can I get rid of
this in code please?

JE McGimpsey

Removing conditional formatting if it exists
 
One way:

Public Sub RemoveCFinColumnN()
Dim wsSheet As Worksheet
On Error Resume Next
Set wsSheet = Sheets("Single")
On Error GoTo 0
If Not wsSheet Is Nothing Then _
wsSheet.Columns(14).FormatConditions.Delete
End Sub


In article ,
"Shaun Allan" wrote:

On a group of spreadsheets, on the sheet names "Single",
column N sometimes has conditional formatting (2
conditions) that shouldn't be there. How can I get rid of
this in code please?


Soo Cheon Jheong[_2_]

Removing conditional formatting if it exists
 
Shaun,

Sub TEST()

On Error Resume Next
Worksheets("Single").Columns(5).FormatConditions.D elete

End Sub


--
Regards,
Soo Cheon Jheong
_ _
^вп^
--





No Name

Removing conditional formatting if it exists
 
Excellent! Thanks!


All times are GMT +1. The time now is 12:04 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com