![]() |
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 |
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 |
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 |
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 |
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 |
All times are GMT +1. The time now is 05:21 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com