ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Custom function not computing (#VALUE!) returned (https://www.excelbanter.com/excel-programming/294267-custom-function-not-computing-value-returned.html)

Asheesh Gupta

Custom function not computing (#VALUE!) returned
 
Excel Version 2002 (SP2)

I have a custom function that calculates the number of cells that have
a particular internal color. This file is updated by one user and
opened readonly by upto 10 others. There is a need to be able to have
the 10 others be able to see the changes.

I have added a command button so that a user can click an execute a
macro to "refresh the view". I have tried the Updatefromfile technique
as well as written the code to close the file and then reopen the
exact same file and neither of them seem to work. I continue to get
the #VALUE! error in each cell that is using the custom formula.

(I have set the Application.Volatile to True as the first line in the
UDF).

Any help would be much appreciated.

Thanks.

Asheesh

Bob Phillips[_6_]

Custom function not computing (#VALUE!) returned
 
what does the code look like?

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Asheesh Gupta" wrote in message
om...
Excel Version 2002 (SP2)

I have a custom function that calculates the number of cells that have
a particular internal color. This file is updated by one user and
opened readonly by upto 10 others. There is a need to be able to have
the 10 others be able to see the changes.

I have added a command button so that a user can click an execute a
macro to "refresh the view". I have tried the Updatefromfile technique
as well as written the code to close the file and then reopen the
exact same file and neither of them seem to work. I continue to get
the #VALUE! error in each cell that is using the custom formula.

(I have set the Application.Volatile to True as the first line in the
UDF).

Any help would be much appreciated.

Thanks.

Asheesh




Asheesh Gupta

Custom function not computing (#VALUE!) returned
 
Function CdlColorCountIf(SearchArea As Range, CdlBgColor As Integer) As Integer

Dim CellCount As Range

Application.Volatile True
For Each CellCount In SearchArea

If CellCount.Interior.ColorIndex = CdlBgColor Then

CdlColorCountIf = CdlColorCountIf + 1

End If
Next CellCount

Calculate


End Function

Thanks. Asheesh
---------------------
what does the code look like?

--

HTH

Bob Phillips



All times are GMT +1. The time now is 01:33 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com