Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How to write an average formula from VBA- SHOULD BE SIMPLE!


Two ways:


Sub AverageThem1()

x =WorkSheetFunction.Average(Range("b4"), Range("e6"))
MsgBox x

End Sub

Or to write Average Formula to WorkSheet cell, say Range F2

Sub AverageThem2()

Range("F2").Formula="=Average(b4,e6)"

End Su

--
david
-----------------------------------------------------------------------
davidm's Profile: http://www.excelforum.com/member.php...fo&userid=2064
View this thread: http://www.excelforum.com/showthread.php?threadid=47501

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Write formula for simple copy and paste to another cell Kalffiend Excel Worksheet Functions 1 January 12th 10 09:10 PM
Calculated field in pivot table, simple Average formula Suzanne Excel Discussion (Misc queries) 2 March 23rd 07 10:58 AM
Help I need to know how to write a simple formula, not having any cbexcel Excel Discussion (Misc queries) 4 December 7th 06 09:36 PM
simple average formula...can you solve it in principle? krasavchik Excel Discussion (Misc queries) 2 April 25th 06 06:48 PM
How to write an average formula from VBA- SHOULD BE SIMPLE! Mike Fogleman Excel Programming 0 October 11th 05 12:59 PM


All times are GMT +1. The time now is 06:39 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"