About Average and Stdev code in VBA-waiting for your help online.

  • Thread starter Thread starter Together
  • Start date Start date
T

Together

Hi, everyone,

I try to write some code to calculate the average and standar
deviation for some range in excel. But I found my code can not work:

n = Sheets(1).Range("A11:K11").average
or

n=average(A11:K11) (the error shows I did not define the function)

I ever search the internet, but I found most of the users use the exce
formula to calculate the value. Can I write code to solve the problem
How to write it? Thank you
 
Hi
try
n = worksheetfunction.average(sheets(1).range("A11:K11"))
 

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