View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.misc
CRH
 
Posts: n/a
Default count number of values between plus signs in addition calc

That *almost* worked. Thank you! The only problem is that I have to *OPEN*
'personal.xls' for the function to work.

Based on reading the reference material a few times, this is what I did:
1. Open C;\data\MS\excel\startup\personal.xls (I did a find to locate
'personal.xls')
2. Click on "Tools", "Macro", "Visual Basic Editor"
3. Cut and Paste the "CountAdd" function from your response into the white
board area.
4. Save in Visual Basic Editor, and close the editor.
5. Open my data spreadsheet.
6. Specify the function CountAdd, including its source location of
personal.xls: =personal.xls!CountAdd(<the cell location with the entry I
needed to parse)

Then it worked beautifully.

But once I closed all my spreadsheets, then I tried to open my data
spreadsheet, I got the prompt: "update" "don't update" links. If I chose
"update", I got the error that the links could not be updated. But, if I
then opened the personal.xls spreadsheet, all of the function calls resolved.

Otherwise, if I chose "don't update links", the data sheet opened, and any
previous calls to "CountAdd" had valid values. But if I entered a new call
to "CountAdd", the new one and any previous ones all became unresolved. In
that case, also, if I opened personal.xls, then everything resolved.

How do I make it so that I can open my data spreadsheet, and issue
additional calls to the "CountAdd" function, and NOT have to open
personal.xls?

- Cathy

"CRH" wrote:

I'd like to count the number of values that a user enters in an excel simple
addition calculation.

For example, if the cell has "=17+256", I'd like to get the count of "2".
If the cell has "=101+2+0+65", I'd like to get the count of "4". Is there a
way to parse this 'function' string?

Everything I've tried so far starts *after* the cell value has been
calculated (e.g. it's working with a single value of 273 and a single value
of 168 for the two examples above, respectively).

Thanks,
- Cathy