PDA

View Full Version : [SOLVED:] Refresh custom formulars that checks background color and output as 1 or 0 (File here



Schutzhofer
02-01-2023, 05:51 AM
Hey guys!

I'm currently struggling with a small formating code and like to refresh a row of formulas that have a macro for background color check in them.
Unfortunately the refreshing methodes that I found only refresh if a cell value changes, not the background color. I also want to change True and False to 1 and 0 somehow.

30489
30490

30491

p45cal
02-01-2023, 08:27 AM
Unfortunately the refreshing methodes that I found only refresh if a cell value changes, not the background color.Yes that's true, I think the best you can do is to do it on selection change as you've attempted but use:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
ActiveSheet.EnableCalculation = False
ActiveSheet.EnableCalculation = True
End Sub


I also want to change True and False to 1 and 0 somehow.Just put a double negative (I think it's called a double unary) in front of the function:
=--IsCellColour(A13)

Schutzhofer
02-01-2023, 08:47 AM
Yes that's true, I think the best you can do is to do it on selection change as you've attempted but use:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
ActiveSheet.EnableCalculation = False
ActiveSheet.EnableCalculation = True
End Sub

Just put a double negative (I think it's called a double unary) in front of the function:
=--IsCellColour(A13)

Yes absolutely. And yes it works like a charm, just like I wanted.
I can extend on that, thank you! :)