Macro Error: Unable to get Var property

  • Thread starter Thread starter Peter Bernadyne
  • Start date Start date
P

Peter Bernadyne

My macro appears to have trouble calculating variance (using th
worksheet function) for a range of cells I have.

The code I have is:

Lead_Y = ((WorksheetFunction.count("A:A") - 1)
WorksheetFunction.Var("A:A")) / WorksheetFunction.Var(Original_Y)

Where Original_Y is defined as:

Set Original_Y = Worksheets("Sheet1").Range("A3:A300")

My error is:

Run-time error '1004':

Unable to get the Var property of the WorksheetFunction class

Any ideas why I might be getting this message would be tremendousl
appreciated.

Thanks,

-Pet
 
Hi
try
Lead_Y = ((WorksheetFunction.count("A:A") - 1) *
WorksheetFunction.Var(Range("A:A"))) /
WorksheetFunction.Var(Original_Y)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top