<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; AHK: FormatConditions.Delete c сохранением цвета ячейки]]></title>
	<link rel="self" href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=13903&amp;type=atom" />
	<updated>2018-07-02T06:30:09Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=13903</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: FormatConditions.Delete c сохранением цвета ячейки]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=126608#p126608" />
			<content type="html"><![CDATA[<p>Надстройка Asup utilities - формат -заменить в выделении условное форматирование на статическое.</p>]]></content>
			<author>
				<name><![CDATA[red2881]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=30934</uri>
			</author>
			<updated>2018-07-02T06:30:09Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=126608#p126608</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: FormatConditions.Delete c сохранением цвета ячейки]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=126603#p126603" />
			<content type="html"><![CDATA[<p>Спасибо, нашёл рабочий vba, попробую его переделать<br /></p><div class="codebox"><pre><code>Option Explicit

Sub NonConditionalFormatting()
&#039; Slightly modified version of http://www.experts-exchange.com/Software/Office_Productivity/Office_Suites/MS_Office/Excel/Q_24179503.html
Dim cel As Range
Dim boo As Boolean
Dim frmla As String
Dim i As Long
Dim v As Variant
Dim w As Variant
Application.ScreenUpdating = False
&#039;For Each cel In ActiveSheet.UsedRange  &#039;Remove conditional formatting from entire worksheet
For Each cel In Selection   &#039;Remove conditional formatting from selected cells
    If cel.FormatConditions.Count &gt; 0 Then
        cel.Activate
        With cel.FormatConditions
            For i = 1 To .Count
                frmla = .Item(i).Formula1
                frmla = UnlocaleFormula(frmla)
                If Left(frmla, 1) = &quot;=&quot; Then
                    v = Application.Evaluate(frmla)
                    On Error Resume Next
                        w = v
                        w = v(1)
                    On Error GoTo 0
                    boo = IIf(IsError(w), False, CBool(w))
                Else
                    Select Case .Item(i).Operator
                    Case xlEqual  &#039; =
                        frmla = cel &amp; &quot;=&quot; &amp; .Item(i).Formula1
                    Case xlNotEqual
                        frmla = cel &amp; &quot;&lt;&gt;&quot; &amp; .Item(i).Formula1
                    Case xlBetween
                        frmla = &quot;AND(&quot; &amp; .Item(i).Formula1 &amp; &quot;&lt;=&quot; &amp; cel &amp; &quot;,&quot; &amp; cel &amp; &quot;&lt;=&quot; &amp; .Item(i).Formula2 &amp; &quot;)&quot;
                    Case xlNotBetween
                        frmla = &quot;OR(&quot; &amp; .Item(i).Formula1 &amp; &quot;&gt;&quot; &amp; cel &amp; &quot;,&quot; &amp; cel &amp; &quot;&gt;&quot; &amp; .Item(i).Formula2 &amp; &quot;)&quot;
                    Case xlLess
                        frmla = cel &amp; &quot;&lt;&quot; &amp; .Item(i).Formula1
                    Case xlLessEqual
                        frmla = cel &amp; &quot;&lt;=&quot; &amp; .Item(i).Formula1
                    Case xlGreater
                        frmla = cel &amp; &quot;&gt;&quot; &amp; .Item(i).Formula1
                    Case xlGreaterEqual
                        frmla = cel &amp; &quot;&gt;=&quot; &amp; .Item(i).Formula1
                    End Select
                    boo = Application.Evaluate(frmla)
                End If
                If boo Then
                    cel.Font.ColorIndex = .Item(i).Font.ColorIndex
                    cel.Interior.ColorIndex = .Item(i).Interior.ColorIndex
                    Exit For
                End If
            Next i
            .Delete
        End With
    End If
Next cel
Application.ScreenUpdating = True
End Sub
                    
Public Function UnlocaleFormula(ByVal Formula As String) As String
    With ThisWorkbook.Worksheets(1).Range(&quot;IU1&quot;)
        .FormulaLocal = Formula
        UnlocaleFormula = .Formula
        .ClearContents
    End With
End Function</code></pre></div>]]></content>
			<author>
				<name><![CDATA[inseption86]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=38818</uri>
			</author>
			<updated>2018-07-01T15:10:57Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=126603#p126603</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: FormatConditions.Delete c сохранением цвета ячейки]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=126602#p126602" />
			<content type="html"><![CDATA[<p><strong>inseption86</strong>, тогда попробуйте поиграться со свойством ячеек .DisplayFormat для определения текущего состояния с учётом условного форматирования, вроде бы оно должно подходить для сего судя по описанию. Мне играться не на чем — не та версия.</p>]]></content>
			<author>
				<name><![CDATA[alexii]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=1844</uri>
			</author>
			<updated>2018-07-01T15:00:31Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=126602#p126602</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: FormatConditions.Delete c сохранением цвета ячейки]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=126601#p126601" />
			<content type="html"><![CDATA[<p><strong>alexii</strong> 2010 и 2013</p>]]></content>
			<author>
				<name><![CDATA[inseption86]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=38818</uri>
			</author>
			<updated>2018-07-01T14:46:43Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=126601#p126601</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: FormatConditions.Delete c сохранением цвета ячейки]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=126600#p126600" />
			<content type="html"><![CDATA[<p><strong>inseption86</strong>, какая у Вас версия Microsoft Office?</p>]]></content>
			<author>
				<name><![CDATA[alexii]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=1844</uri>
			</author>
			<updated>2018-07-01T14:29:49Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=126600#p126600</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: FormatConditions.Delete c сохранением цвета ячейки]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=126599#p126599" />
			<content type="html"><![CDATA[<p><strong>alexii</strong> ДА,</p>]]></content>
			<author>
				<name><![CDATA[inseption86]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=38818</uri>
			</author>
			<updated>2018-07-01T13:21:46Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=126599#p126599</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: FormatConditions.Delete c сохранением цвета ячейки]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=126598#p126598" />
			<content type="html"><![CDATA[<p><strong>inseption86</strong>, Вы имеете в виду — определить текущее цветовое оформление ячейки в зависимости от условного форматирования, затем удалить условное форматирование, затем напрямую задать то же самое цветовое оформление ячейке принудительно, так?</p>]]></content>
			<author>
				<name><![CDATA[alexii]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=1844</uri>
			</author>
			<updated>2018-07-01T13:11:30Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=126598#p126598</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[AHK: FormatConditions.Delete c сохранением цвета ячейки]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=126597#p126597" />
			<content type="html"><![CDATA[<p>Добрый день, подскажите пож-та возможно ли удалить УФ, но сохранить цветовые параметры?</p><br /><div class="codebox"><pre><code>path =* .xlsx
Xl := ComObjCreate(&quot;Excel.Application&quot;)
Xl.Workbooks.Open(Path)
Xl.Visible := true

xl.Worksheets(1).Range(&quot;A1:A10&quot;).FormatConditions.Delete</code></pre></div>]]></content>
			<author>
				<name><![CDATA[inseption86]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=38818</uri>
			</author>
			<updated>2018-07-01T11:06:53Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=126597#p126597</id>
		</entry>
</feed>
