<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Серый форум &mdash; AHK: FormatConditions.Delete c сохранением цвета ячейки]]></title>
		<link>https://forum.script-coding.com/viewtopic.php?id=13903</link>
		<atom:link href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=13903&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[Недавние сообщения в теме «AHK: FormatConditions.Delete c сохранением цвета ячейки».]]></description>
		<lastBuildDate>Mon, 02 Jul 2018 06:30:09 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: AHK: FormatConditions.Delete c сохранением цвета ячейки]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=126608#p126608</link>
			<description><![CDATA[<p>Надстройка Asup utilities - формат -заменить в выделении условное форматирование на статическое.</p>]]></description>
			<author><![CDATA[null@example.com (red2881)]]></author>
			<pubDate>Mon, 02 Jul 2018 06:30:09 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=126608#p126608</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: FormatConditions.Delete c сохранением цвета ячейки]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=126603#p126603</link>
			<description><![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>]]></description>
			<author><![CDATA[null@example.com (inseption86)]]></author>
			<pubDate>Sun, 01 Jul 2018 15:10:57 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=126603#p126603</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: FormatConditions.Delete c сохранением цвета ячейки]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=126602#p126602</link>
			<description><![CDATA[<p><strong>inseption86</strong>, тогда попробуйте поиграться со свойством ячеек .DisplayFormat для определения текущего состояния с учётом условного форматирования, вроде бы оно должно подходить для сего судя по описанию. Мне играться не на чем — не та версия.</p>]]></description>
			<author><![CDATA[null@example.com (alexii)]]></author>
			<pubDate>Sun, 01 Jul 2018 15:00:31 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=126602#p126602</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: FormatConditions.Delete c сохранением цвета ячейки]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=126601#p126601</link>
			<description><![CDATA[<p><strong>alexii</strong> 2010 и 2013</p>]]></description>
			<author><![CDATA[null@example.com (inseption86)]]></author>
			<pubDate>Sun, 01 Jul 2018 14:46:43 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=126601#p126601</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: FormatConditions.Delete c сохранением цвета ячейки]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=126600#p126600</link>
			<description><![CDATA[<p><strong>inseption86</strong>, какая у Вас версия Microsoft Office?</p>]]></description>
			<author><![CDATA[null@example.com (alexii)]]></author>
			<pubDate>Sun, 01 Jul 2018 14:29:49 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=126600#p126600</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: FormatConditions.Delete c сохранением цвета ячейки]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=126599#p126599</link>
			<description><![CDATA[<p><strong>alexii</strong> ДА,</p>]]></description>
			<author><![CDATA[null@example.com (inseption86)]]></author>
			<pubDate>Sun, 01 Jul 2018 13:21:46 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=126599#p126599</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: FormatConditions.Delete c сохранением цвета ячейки]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=126598#p126598</link>
			<description><![CDATA[<p><strong>inseption86</strong>, Вы имеете в виду — определить текущее цветовое оформление ячейки в зависимости от условного форматирования, затем удалить условное форматирование, затем напрямую задать то же самое цветовое оформление ячейке принудительно, так?</p>]]></description>
			<author><![CDATA[null@example.com (alexii)]]></author>
			<pubDate>Sun, 01 Jul 2018 13:11:30 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=126598#p126598</guid>
		</item>
		<item>
			<title><![CDATA[AHK: FormatConditions.Delete c сохранением цвета ячейки]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=126597#p126597</link>
			<description><![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>]]></description>
			<author><![CDATA[null@example.com (inseption86)]]></author>
			<pubDate>Sun, 01 Jul 2018 11:06:53 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=126597#p126597</guid>
		</item>
	</channel>
</rss>
