worksheet function?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Mm..how to write average worksheet function in VBA? worksheetfunction.average?

How do I reference to the range of cells in another worksheet? Is it like
this, WorksheetFunction.Average (Range("fulldata for c1")("C3:C9"))?

Thanks!
 
Hi
msgbox application.worksheetfunction.average(Range("C3:C9"))
 
dblAvg = WorksheetFunction.Average
(Worksheets("Sheet1").Range("C3:C9").Value)
 
Do to write the below in VBA? I used

Range("C4").Select
Range("c4") = WorksheetFunction.Average(Range("M3:M9"))
Range("C4").Select
Selection.AutoFill Destination:=Range("C4:I4"), Type:=xlFillDefault
Range("C4:I4").Select
-----------------------------
in C4: =AVERAGE(M3:M9)

then copy across to I4

--------------------------------------------
 
Worksheetfunction.Average(Worksheets("fulldata for c1").Range("A1:G1"))

--

HTH

RP
(remove nothere from the email address if mailing direct)
 
Do to write the below in VBA? I used

Range("C4").Select
Range("c4") = WorksheetFunction.Average(Range("M3:M9"))
Range("C4").Select
Selection.AutoFill Destination:=Range("C4:I4"), Type:=xlFillDefault
Range("C4:I4").Select
 
Sub AA()
Range("c4").Formula = "=Average(M3:M9)"
Range("C4").AutoFill Destination:=Range("C4:I4"), Type:=xlFillDefault
End Sub
 
Sub AA()
Range("c4").Formula = "=Average(M3:M9)"
Range("C4").AutoFill Destination:=Range("C4:I4"), Type:=xlFillDefault
End Sub
 

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