Passing arguments from Excel to a UserForm.
VBA Telemetry pings you when your VBA projects fail
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 3 of 3

Thread: Passing arguments from Excel to a UserForm.

  1. #1
    New Member
    Join Date
    Mar 2002
    Posts
    9
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

     
    Can anyone provide an example passing an array of values from an excel macro to a UserForm. Can't seem to find anything in the books or help box.

    Thanks in advance

  2. #2
    MrExcel MVP Mark O'Brien's Avatar
    Join Date
    Feb 2002
    Location
    Columbus, OH, USA
    Posts
    3,530
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    You need to use ByRef to pass arrays. For example, if I've got a function in a standard module that needs a string array as an argument I would declare the function like this:


    Private Function MyArrayFunction(ByRef sArray() as String)
    '...
    End Function


    If this Function is on a UserForm or Class Module and you wanted to call them from outside of that module you woud have to declare the function like this:


    Public Function MyArrayFunction(ByRef sArray() as String)
    '...
    End Function


    HTH

  3. #3
    New Member
    Join Date
    Mar 2002
    Posts
    9
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

      
    Thank you!!

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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

 

 
DMCA.com