Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Function with parameter "as range"
What are you supposed to pass to a function that has a parameter "range" data
type? I have tried the following: msgbox functionname(range("a1:a10").address) msgbox functionname(range("a1:a10").range) msgbox functionname(range("a1:a10")) msgbox functionname("a1:a10") msgbox functionname(a1:a10) -- Thanks, Mike |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Function with parameter "as range"
In article ,
says... What are you supposed to pass to a function that has a parameter "range" data type? I have tried the following: msgbox functionname(range("a1:a10").address) msgbox functionname(range("a1:a10").range) msgbox functionname(range("a1:a10")) msgbox functionname("a1:a10") msgbox functionname(a1:a10) And, what were the results? -- Regards, Tushar Mehta www.tushar-mehta.com Excel, PowerPoint, and VBA add-ins, tutorials Custom MS Office productivity solutions |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Function with parameter "as range"
It should be
msgbox functionname(range("a1:a10")) What hapopens when you do that? Can it handle multiple cells? -- HTH Bob Phillips (remove nothere from the email address if mailing direct) "Mike Archer" wrote in message ... What are you supposed to pass to a function that has a parameter "range" data type? I have tried the following: msgbox functionname(range("a1:a10").address) msgbox functionname(range("a1:a10").range) msgbox functionname(range("a1:a10")) msgbox functionname("a1:a10") msgbox functionname(a1:a10) -- Thanks, Mike |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Function with parameter "as range"
Mike
an example: Function FunctionName(ByVal rng As Range) N = 0 For Each cell In rng N = N + cell.Value Next FunctionName = N End Function Sub test() MsgBox FunctionName(Range("g1:g5")) End Sub Or from a worksheet: =FunctionName(g1:g5) HTH "Mike Archer" wrote: What are you supposed to pass to a function that has a parameter "range" data type? I have tried the following: msgbox functionname(range("a1:a10").address) msgbox functionname(range("a1:a10").range) msgbox functionname(range("a1:a10")) msgbox functionname("a1:a10") msgbox functionname(a1:a10) -- Thanks, Mike |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Function with parameter "as range"
It should be like this
msgbox functionname(range("a1:a10")) Which is passing cells A1:A10 of the acitve sheet to the function. If that is not working you will need to post your code... -- HTH... Jim Thomlinson "Mike Archer" wrote: What are you supposed to pass to a function that has a parameter "range" data type? I have tried the following: msgbox functionname(range("a1:a10").address) msgbox functionname(range("a1:a10").range) msgbox functionname(range("a1:a10")) msgbox functionname("a1:a10") msgbox functionname(a1:a10) -- Thanks, Mike |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Parameter "TwoDimension" on RowVector function | Excel Worksheet Functions | |||
"Empty" values in holiday parameter for NETWORKDAYS() function | Excel Worksheet Functions | |||
use variable in Workbooks("book1").Worksheets("sheet1").Range("a1" | Excel Programming | |||
Using "Cells" to write "Range("A:A,H:H").Select" | Excel Programming |