Hello all,
I have been using this custom function to automatically highlight off days columns in timesheet except for cells that already have fill color. It used to work fine but I recently moved to excel 2016 from 2013. I am not sure but I think it worked for some time in excel 2016 too but now whenever I copy or cut any cells or range including one row above and below where this custom function is used to apply conditional formatting, excel crashes. For example, In the attached workbook I have applied conditional formatting to $5:$10. And if I try to copy or cut cells from $4:$11, excel just crashes. Sometimes, excel will restart after crashing and sometimes it will just stay closed.
Here's the custom function:
>>> use code - tags <<<
Any help will be appreciated!
I have been using this custom function to automatically highlight off days columns in timesheet except for cells that already have fill color. It used to work fine but I recently moved to excel 2016 from 2013. I am not sure but I think it worked for some time in excel 2016 too but now whenever I copy or cut any cells or range including one row above and below where this custom function is used to apply conditional formatting, excel crashes. For example, In the attached workbook I have applied conditional formatting to $5:$10. And if I try to copy or cut cells from $4:$11, excel just crashes. Sometimes, excel will restart after crashing and sometimes it will just stay closed.
Here's the custom function:
>>> use code - tags <<<
Code:
Option Explicit
Function ISNOFILL(Optional Rng As Range) As Boolean
Application.Volatile
ISNOFILL = False
If Rng Is Nothing Then
If TypeOf Application.Caller Is Range Then
If Application.Caller.Interior.ColorIndex = xlNone Then
ISNOFILL = True
Else
ISNOFILL = False
End If
End If
Else
If Rng.Interior.ColorIndex = xlNone Then
ISNOFILL = True
Else
ISNOFILL = False
End If
End If
End Function
Attachments
Last edited by a moderator: