0

I hope this isn't a repeat (I looked all over and couldn't find a straight answer - I'm probably missing something obvious).

If it's possible, how is it done? I'm not trying to output to any cells.

3
  • array of string? array of integer? Commented Jun 11, 2015 at 14:22
  • Does it make a difference? I'm asking generally. Commented Jun 11, 2015 at 14:24
  • Are you asking how to do arrays in VBA? There are a bunch of sites detailing how to do it. Here is one and here is another. Or am I not understanding your question? Commented Jun 11, 2015 at 14:25

1 Answer 1

2

Yes. Just put parentheses after the return type in the function.

Here is a simple example function and sub using it:

 Sub test3()
      Dim myarray() As String
      myarray = returnarray()
      MsgBox myarray(2)
 End Sub

 Function returnarray() As String()

      returnarray = Split("test1, test2, test3", ",")

 End Function
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.