Xref: utzoo comp.sys.mac.programmer:10109 comp.sys.mac:41420 Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!uwm.edu!cs.utexas.edu!tut.cis.ohio-state.edu!ucbvax!agate!shelby!barry@playfair From: barry@playfair.STANFORD.EDU (barry) Newsgroups: comp.sys.mac.programmer,comp.sys.mac Subject: Re: Simple Excel Macro Problem Keywords: excel, macro Message-ID: <36@playfair.STANFORD.EDU> Date: 1 Nov 89 20:38:02 GMT References: <1989Nov1.092420.9034@agate.berkeley.edu> Sender: Barrett P. Eynon Reply-To: barry@playfair.UUCP (Barrett P. Eynon) Distribution: usa Organization: Stanford University Lines: 22 In article <1989Nov1.092420.9034@agate.berkeley.edu> gangof4@violet.berkeley.edu (john steggall) writes: >I've got a *really* simple problem with an Excel macro. [...] >I'd like to pass the macro a range of cells (e.g. A1:A50) and have it >count the number of cells which contain a specific value and then return >that number. Specifically, I'm trying to count the number of cells >that have zeros, in a single column of data. [...] > >- john steggall - >gangof4@violet.berkeley.edu >(415) 643-8927 (lab) You probably need to modify the =ARGUMENT() line of your macro to indicate that the argument is an array (e.g. =ARGUMENT("range",64), and also use an array calculation (e.g. {=COUNT(range)}) for your calculations. See The Functions & Macros manual, "Using Arrays in Function Macros", p. 128. Barry Eynon barry@playfair.stanford.edu -ARPA ...!decwrl!shasta!playfair!barry -USENET