![]() |
function "count if color"
Hello, I have a function that counts (or sums) all the cells in a range that
have the same color than the sample cell CountIfColor (Range,SampleCell) I use a For-Next loop, and I compare the color of every cell with the color of the sample cell. The problem comes when I change the color of one of the cells of the range: the function doesn't recalculates. If I change the value goes ok, but if I change the color not. I can't use Worksheet_Change because the function is located in an .xla sheet, and the users do not know how to work with Vb. Can someone give me an idea (maybe a different focus) to help me? Thanks in advance |
function "count if color"
Try to add this code at the beginning of your function:
Application.Volatile it forces Excel to recalculate function every time you change anything on the spreadsheet. Best - RADO "José Ignacio Bella" wrote in message ... Hello, I have a function that counts (or sums) all the cells in a range that have the same color than the sample cell CountIfColor (Range,SampleCell) I use a For-Next loop, and I compare the color of every cell with the color of the sample cell. The problem comes when I change the color of one of the cells of the range: the function doesn't recalculates. If I change the value goes ok, but if I change the color not. I can't use Worksheet_Change because the function is located in an .xla sheet, and the users do not know how to work with Vb. Can someone give me an idea (maybe a different focus) to help me? Thanks in advance |
All times are GMT +1. The time now is 12:07 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com