View Single Post
  #13   Report Post  
Harlan Grove
 
Posts: n/a
Default

ASokolik wrote...
....
This applies to the codes that both Conrad and JE McGimpsey left. Is there
another form of argument that would allow me to enter either a range or a
smattering of random cells as inputs? I tried "As List", but that didn't do
it.


ParamArray. Read about its requirements and limitations in online help.

That said, the built-in AVERAGE worksheet function can accomodate 3D
references as well, e.g., Sheet1:Sheet5!X99:Z100. There's NO WAY to
pass 3D references to VBA functions except as text, and no way to use
them except in Evaluate calls with formulas constructed as strings.
This is MUCH SLOWER and MORE ERROR PRONE than performing the same
calculations in worksheet cell formulas.

In other words, what you've described you want to do is something for
which VBA is CLEARLY INFERIOR to worksheet cell formulas.

But the choice is yours.