hheydinger
New Member
- Joined
- Oct 12, 2014
- Messages
- 3
Can't get ParamArray to work. Have looked at numerous examples online. But nothing sees to work. When I select Debug (F8) for the procedure TableRequest, I get an alarm(ding), but none of the VBA statements get highlighted, not even the Sub line.
VBA code is below. I would really appreciate a solution that works since I'm "tearing my hair out". Thanks.
VBA code is below. I would really appreciate a solution that works since I'm "tearing my hair out". Thanks.
Code:
Sub Test()
' This macro should work for Excel 2003-2013.
Dim sTable1 as String
Dim sTable2 as String
Call Sub TableRequest(sTable1, sTable2)
Debug.Print “Tables are “ & sTable1 & “, ” sTable2
End Sub
***************
Sub TableRequest(ByRef Y() As String)
' Prompt user for all applicable table names.
' This macro should work for Excel 2003-2013.
Dim sPrompt As String
sPrompt = "Enter table name #1."
Y(1) = InputBox(sPrompt, "GET TABLE NAME")
sPrompt = "Enter table name #2."
Y(2) = InputBox(sPrompt, "GET TABLE NAME")
End Sub
Last edited by a moderator: