Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Passing arrays to VBA module

My experience with user defined functions has been limited to simple
procedures using individual data items as arguments. Now, I need to grab
a range of values from the SS, pass them to a function as one or more
arrays, read the arguments into local arrays withing the VBA procedure,
perform my process, and return the function value.

I need a simple illustration of this process but have had no luck with
the Excel/VBA help. Where should I look?

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Passing arrays to VBA module

Here is a simple example

Function mySum(rng As Range) As Long
Dim ary
Dim i As Long
ary = rng
For i = LBound(ary) To UBound(ary)
mySum = mySum + ary(i, 1)
Next i
End Function


--

HTH

RP
(remove nothere from the email address if mailing direct)


"Ralph K" wrote in message
...
My experience with user defined functions has been limited to simple
procedures using individual data items as arguments. Now, I need to grab
a range of values from the SS, pass them to a function as one or more
arrays, read the arguments into local arrays withing the VBA procedure,
perform my process, and return the function value.

I need a simple illustration of this process but have had no luck with
the Excel/VBA help. Where should I look?



Reply
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
Passing Strings from UserForm to Module John Kauffman Excel Programming 3 May 28th 04 05:01 PM
passing arrays between functions in VBA Tom Ogilvy Excel Programming 3 March 1st 04 05:54 PM
arrays - module to module mike Excel Programming 3 February 25th 04 08:56 PM
Passing variables from module to userform Chris Dunigan Excel Programming 4 November 26th 03 09:37 AM
Passing arrays to a subroutine Braden Craig Excel Programming 4 August 17th 03 05:54 PM


All times are GMT +1. The time now is 09:25 PM.

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

About Us

"It's about Microsoft Excel"