Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
How can I get the values inputed into a function from a range of values
Below is an example of the values used in the worksheets. A 1 12 2 15 3 36 4 25 5 18 6 23 For a follow up question, does the range selection always have to b in this format, or can I also use the format below: A B C D E F 1 12 15 36 25 18 23 If yes, how would the function determine between formats -- Message posted from http://www.ExcelForum.com |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi
one way (without much error testing, etc): Function foo_sum (rng as range) Dim cell as range Dim ret_value as double for each cell in rng if IsNumeric(cell.value) then ret_value = ret_value + cell.value end if next foo_sum = ret_value end function And yes you can use a different range layout :-) -- Regards Frank Kabel Frankfurt, Germany How can I get the values inputed into a function from a range of values? Below is an example of the values used in the worksheets. A 1 12 2 15 3 36 4 25 5 18 6 23 For a follow up question, does the range selection always have to be in this format, or can I also use the format below: A B C D E F 1 12 15 36 25 18 23 If yes, how would the function determine between formats? --- Message posted from http://www.ExcelForum.com/ |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Curare,
For Each cell in rng 'do something Next cell Either works. If you use Selection, it doesn't need to differentiate. -- HTH Bob Phillips ... looking out across Poole Harbour to the Purbecks (remove nothere from the email address if mailing direct) "Curare " wrote in message ... How can I get the values inputed into a function from a range of values? Below is an example of the values used in the worksheets. A 1 12 2 15 3 36 4 25 5 18 6 23 For a follow up question, does the range selection always have to be in this format, or can I also use the format below: A B C D E F 1 12 15 36 25 18 23 If yes, how would the function determine between formats? --- Message posted from http://www.ExcelForum.com/ |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Selecting series in a chart based on a range and manual inputs | Excel Discussion (Misc queries) | |||
Using range names in functions | Excel Worksheet Functions | |||
Dynamic Range Name in Functions | Excel Discussion (Misc queries) | |||
How to use functions after sorting a range? | Excel Worksheet Functions | |||
Define inputs and outputs to make functions from sheets | Excel Discussion (Misc queries) |