Results 1 to 2 of 2

array in parameter

Threaded View

  1. #1
    Registered User
    Join Date
    07-25-2012
    Location
    Paris, France
    MS-Off Ver
    Excel 2010
    Posts
    22

    Post array in parameter

    Hi!

    I got a problem. when I'm trying to build an array of integers in a function, I have a message telling me that something of the left part of the function must return a variant or an object :/

    here's the code

    Function stock() As Integer()
    ReDim stock(19)
    
    For i = 0 To 19
    stock(i) = Cells(i + 1, 1).Value
    Next i
    
    End Function
    
    Sub affich(ByRef stock() As Integer)
    
    For i = 0 To 19
    MsgBox (stock()(i))
    Next i
    
    End Sub
    
    Sub launcher()
    Call affich(stock)
    
    End Sub
    Anyone can help me? :/
    Last edited by tibibs; 08-07-2012 at 04:10 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1