Conditional Formatting using a formula written in vba causes splash screen not to work

piguy

New Member
Joined
Aug 26, 2011
Messages
32
If I use the "colorfunction" vba in my conditional formatting of certain cells, the splash screen at the beginning of opening my workbook no longer functions. It's also messing up some of my other macros.

Not sure why this changes it all. If I take the Conditional formatting out of the cells, everything goes back to normal.

Here's the color function
Code:
Function ColorFunction(rColor As Range, rRange As Range, Optional SUM As Boolean)
    Dim rCell As Range
    Dim lCol As Long
    Dim vResult
 
     ''''''''''''''''''''''''''''''''''''''
     'Written by Ozgrid Business Applications
     'www.ozgrid.com
 
     'Sums or counts cells based on a specified fill color.
     '''''''''''''''''''''''''''''''''''''''
 
    lCol = rColor.Interior.ColorIndex
 
    If SUM = True Then
        For Each rCell In rRange
            If rCell.Interior.ColorIndex = lCol Then
                vResult = WorksheetFunction.SUM(rCell, vResult)
            End If
        Next rCell
    Else
        For Each rCell In rRange
            If rCell.Interior.ColorIndex = lCol Then
                vResult = 1 + vResult
            End If
        Next rCell
    End If
 
    ColorFunction = vResult
    Application.Volatile
End Function

Here's the conditional formatting
Code:
=AND(ColorFunction($AE$3,I2,FALSE),A3="",A2<$M$52,LEN(C2)<3)
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
I wrote the CF into a subroutine instead and that made everything work as normal again.
This isn't the true answer to the problem, but a decent work around I suppose. I'm just a hack at this stuff anyways ;)
 
Upvote 0

Forum statistics

Threads
1,224,551
Messages
6,179,480
Members
452,915
Latest member
hannnahheileen

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top