Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Format when sending a range as parameter to a custom function
Hello,
I created a custom functiom for which I need to send a range (A1:A5), that I will loop throu in my function. Please indicate what the funtion definition will looklike, ie how do I specify that it will receive a range in that format? I do have the code that will loop through the cells. Kind regards George |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Format when sending a range as parameter to a custom function
Something like this... (hard to tell from your question)
Public Sub SendRange() Dim dblAmount As Double dblAmount = RecieveRange(Sheets("Sheet1").Range("A1:A5")) MsgBox "The total is " & dblAmount End Sub Public Function RecieveRange(ByVal MyRange As Range) As Double Dim rng As Range Dim dblTotal As Double For Each rng In MyRange dblTotal = dblTotal + rng.Value Next rng RecieveRange = dblTotal End Function -- HTH... Jim Thomlinson "George Furnell" wrote: Hello, I created a custom functiom for which I need to send a range (A1:A5), that I will loop throu in my function. Please indicate what the funtion definition will looklike, ie how do I specify that it will receive a range in that format? I do have the code that will loop through the cells. Kind regards George |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Format when sending a range as parameter to a custom function
Thank you so much.
Kind regards George |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Custom Format or use function? | Excel Worksheet Functions | |||
user defined function receiving a range as parameter | Excel Programming | |||
Excel2000: Reading values from range, passed to function as parameter using an expression | Excel Programming | |||
Defining new function with cell range parameter | Excel Programming | |||
Translate range name passed as string to a custom function to range addresses! | Excel Programming |