Opening xlsm files with conditional formatting opens with removed conditional formatting
I have insert some VB code to add one or more checkboxes via a macro.
After I have inserted such checkboxes using the macro and saved as .xlsm, the next time I open the files, Excel tells me that it has removed the conditional formatting.
All security options are set to their lowest security. Does anyone have an idea why this keeps coming up?
On Error Resume Next
Dim c As Range, myRange As Range
Set myRange = Selection
For Each c In myRange.Cells
ActiveSheet.CheckBoxes.Add(c.Left, c.Top, c.Width, c.Height).Select
.LinkedCell = c.Address
.Characters.Text = ""
.Name = c.Address
.FormatConditions.Add Type:=xlExpression, _
Formula1:="=" & c.Address & "=TRUE"
.FormatConditions(1).Font.ColorIndex = 6 'change for other color when ticked
.FormatConditions(1).Interior.ColorIndex = 6 'change for other color when ticked
.Font.ColorIndex = 2 'cell background color = White
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
By mgerada in forum Excel Formulas & Functions
Last Post: 07-09-2021, 05:56 AM
By omni13 in forum Excel Programming / VBA / Macros
Last Post: 10-29-2013, 06:52 AM
By Sparkan in forum Excel General
Last Post: 04-17-2012, 11:15 AM
By glupi in forum Excel General
Last Post: 06-05-2008, 06:31 AM
By Bill Foley in forum Excel Formulas & Functions
Last Post: 10-19-2005, 07:05 PM
Search Engine Friendly URLs by vBSEO 3.6.0 RC 1