Hi All

I am hoping someone can help. I am using the following function along with some conditional formatting to show which cells in a range contain a formula:

Function HasFormula(rCell As Range) As Boolean
    Application.Volatile
    HasFormula = rCell.HasFormula
End Function
But for some reason this causes the [Workbook_Open] and [Workbook_Activate] events not to trigger when the workbook is opened??

I've been playing with several workarounds but think the easiest fix would be to toggle HasFormula on/off as needed. I've added a toggle button to the sheet:

Private Sub ToggleButton1_Click()     
        If ToggleButton1.value = True Then
            MsgBox "HasFormula is switched on"
        End If
   
End Sub
But I can't figure out how to replace the message box with the HasFormula function?

Any help would be greatly apprecaited

Thanks all
Vicky