Hi
So, in order to calculate the amount of cells not in bold in a column (that are set manually), I've created the formula "SENEGRITO" (IFBOLD in portuguese) using the module:
Public Function SENEGRITO(MyCell As Range) As Variant
SENEGRITO = MyCell.Font.Bold
End Function
I then added a new column with the formula:
and so I could count the amount of "FALSE" there.
And it worked great. The thing is, whenever I filter the table using
Private Sub Filtrar_int_Click()
ActiveSheet.ListObjects("Intimacoes").Range.AutoFilter Field:=6, Criteria1:=""
End Sub
all the results from the formula SENEGRITO return #Value.
If I then run
Private Sub Mostrar_int_Click()
ActiveSheet.ListObjects("Intimacoes").AutoFilter.ShowAllData
End Sub
It all works again.
If instead of filtering using the VBA code, I apply the same filter manually, there's no error.
If I edit a cell with the error mesagem without changing anything in it, this cell (and only it) shows the correct value.
Does anyone now why this is happening and what I could do to fix it?
I know that changing the format from a cell to bold is not ideal as a way of marking it, but the table is already complex, and is also used by people with no experience in excel, so I'm trying to make it as simple as possible for the end user.