View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_6_] Bob Phillips[_6_] is offline
external usenet poster
 
Posts: 11,272
Default call a function from VBA

Adam,

Two things spring to mind.

Have you stored the code in a general code module (not a form, sheet module
or ThisWorkbook)?

Also, but I don't think this is the problem, you are using continental
separators (; not ,). Is this correct for your Excel?

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Adam" wrote in message
...
I have some functions in VBA e.g. one that is called
Function CountByColor(InRange As Range, WhatColorIndex As Integer,

Optional
OfText As Boolean = False) As Long.

When i write =CountByColor(A2:A4;3;FALSE) in my worksheet it returns

#NAME?.
What am I doing wrong?