Thread: VBA arrays
View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
AA2e72E AA2e72E is offline
external usenet poster
 
Posts: 400
Default VBA arrays

Another solution:

Sub xx()
' Just an array to use
a = Evaluate("{1,2,3,4,5,6,7,8,9,10}")
' Create another array from the given a
b = Evaluate("{" & a(5) & "," & a(6) & "," & a(7) & "," & a(8) & "}")
' call the function using the subset
Call myfn(b)
End Sub


"hokiebird" wrote:


Hello all, first time post

I'm trying to access only part of an array.

Suppose A in an array of integers with 10 cells...
Dim A(1 to 10) as integer

...some code to fill up A

Now lets say I want to call a subroutine with only cells 4-8, how do I
do this?

In other codes we can do something like this...
Call SomeSub(A(4:8))
but i can't for the life of me figure out how to do this in VBA...
HELP!


--
hokiebird
------------------------------------------------------------------------
hokiebird's Profile: http://www.excelforum.com/member.php...o&userid=16308
View this thread: http://www.excelforum.com/showthread...hreadid=276996