LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default help with worksheet functions

hi

i need to implement some of excells more advanced features in my code.
Im starting with averaging. The code I have written is meant to do th
same thing as

{average(if.....

but i need to automate more of the tasks and such

here is the code i have written


Sub average_test()

Dim hope As Long

Range("a2:e2").Select

For Each cell In Selection
If cell = 1 Then
hope = Application.WorksheetFunction.Average(cell.Offset( 1, 0))
End If
Next

MsgBox (hope)

End Sub

it just returns the valve under the last cell in A2:E3 that is = 1.
it doesn't average them all.

help pleas

--
Message posted from http://www.ExcelForum.com

 
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
Worksheet Functions Steve Peel Excel Worksheet Functions 12 August 25th 08 05:06 AM
Help with worksheet functions Angeline Excel Discussion (Misc queries) 2 October 11th 06 11:19 PM
Worksheet functions Joe D. Excel Worksheet Functions 0 March 8th 06 02:24 PM
Is there such worksheet functions... Conan Kelly Excel Worksheet Functions 4 October 13th 05 10:11 PM
VBA Functions for use in Worksheet ZootRot Excel Programming 3 October 10th 03 10:29 AM


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

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

About Us

"It's about Microsoft Excel"