LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default how do I pass myfunction(A2:A4) instead of myfunction("A2:A4")

Thank you.

"Chip Pearson" wrote:

You could use code similar to the following:

Function Concat(RR As Range) As String
Dim S As String
Dim R As Range
For Each R In RR.Cells
S = S & R.Text
Next R
Concat = S
End Function

Then, call this from a worksheet with

=Concat(A1:A100)

Cordially,
Chip Pearson
Microsoft MVP
Excel Product Group
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)




On Wed, 26 Nov 2008 07:16:05 -0800, Andy B
wrote:

as usual, I wasn't too clear. I want to call the function from an excel cell
in a worksheet. In the same manner that you can use SUM(A1:A100), I want to
do myfunction(A1:A100). I am trying to build a more general concatenate
function - concatenate(A1:A100) -

"JLGWhiz" wrote:

Just an added comment. If you use A1 format for a range, it has to be a
string. Using the Cells format the row and column index numbers are numeric
as are the numbers in the R1C1 format. If you were referring to the $A$1
format, The $ symbol in this case indicates absolute reference, as opposed
to relative reference, and not to be confused with when it used as a type
designation character.

"Andy B" wrote:

I want to define a function that takes a range in and operates on that range.
I want to use the normal Excel method of defining the range as (A2:A4), not
as a string. (If I use the string format, excel doesn't recalculate the
function when the data in the range changes)

when I define
function myfunction (inrange as Range) , the function call seems to fail.


 
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
Search ideas to by pass Bug "OnAction" with parameters XP/ XL2K SP3 john2 Excel Programming 0 October 3rd 08 10:21 PM
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell Steve Kay Excel Discussion (Misc queries) 2 August 8th 08 01:54 AM
change "true" and "false" to "availble" and "out of stock" inthestands Excel Worksheet Functions 2 July 19th 07 07:05 PM
HELP on "left","right","find","len","substitute" functions serene83 Excel Discussion (Misc queries) 5 June 27th 06 02:23 AM
Count occurences of "1"/"0" (or"TRUE"/"FALSE") in a row w. conditions in the next BCB New Users to Excel 7 May 13th 06 10:02 PM


All times are GMT +1. The time now is 11:47 PM.

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

About Us

"It's about Microsoft Excel"