Discussion:
VBA Sub Procedure argument from Key-In ?
(too old to reply)
Vikas Bhatia
2003-07-16 11:00:54 UTC
Permalink
I have a sub procedure in VBA which requires arguments and I want to
pass these arguments through key-in 'VBA RUN'.

Example:
Sub Test(X As Integer)
---
---
End Sub

Is there any trick where I could pass the value of X to Test() from
Key-In,
Say, 'VBA RUN Test 123' ?

There was another way in Microstation Basic Macro using Command$
function (command line argument), but VBA doesn't seems supporting
Command$ Function.

Thanks,
Vikas
Dave Preston
2003-07-16 18:14:45 UTC
Permalink
You should be able to do exactly what you have stated. I have only done it
with sub main:-
-
vba run main newdesk

To check the arguments passed use the KeyinArguments function
--

Regards
Dave Preston
***@cadesignservices.co.uk

www.cadesignservices.co.uk
Post by Vikas Bhatia
I have a sub procedure in VBA which requires arguments and I want to
pass these arguments through key-in 'VBA RUN'.
Sub Test(X As Integer)
---
---
End Sub
Is there any trick where I could pass the value of X to Test() from
Key-In,
Say, 'VBA RUN Test 123' ?
There was another way in Microstation Basic Macro using Command$
function (command line argument), but VBA doesn't seems supporting
Command$ Function.
Thanks,
Vikas
Vikas Bhatia
2003-07-17 09:12:28 UTC
Permalink
Got It !!! I didn't notice KeyinArguments before.

Thanks Dave,
Vikas
Post by Dave Preston
You should be able to do exactly what you have stated. I have only done it
with sub main:-
-
vba run main newdesk
To check the arguments passed use the KeyinArguments function
--
Regards
Dave Preston
www.cadesignservices.co.uk
Post by Vikas Bhatia
I have a sub procedure in VBA which requires arguments and I want to
pass these arguments through key-in 'VBA RUN'.
Sub Test(X As Integer)
---
---
End Sub
Is there any trick where I could pass the value of X to Test() from
Key-In,
Say, 'VBA RUN Test 123' ?
There was another way in Microstation Basic Macro using Command$
function (command line argument), but VBA doesn't seems supporting
Command$ Function.
Thanks,
Vikas
Dave Preston
2003-07-17 17:48:38 UTC
Permalink
You're welcome

--

Regards
Dave Preston
***@cadesignservices.co.uk

www.cadesignservices.co.uk
Post by Vikas Bhatia
Got It !!! I didn't notice KeyinArguments before.
Thanks Dave,
Vikas
Post by Dave Preston
You should be able to do exactly what you have stated. I have only done it
with sub main:-
-
vba run main newdesk
To check the arguments passed use the KeyinArguments function
--
Regards
Dave Preston
www.cadesignservices.co.uk
Post by Vikas Bhatia
I have a sub procedure in VBA which requires arguments and I want to
pass these arguments through key-in 'VBA RUN'.
Sub Test(X As Integer)
---
---
End Sub
Is there any trick where I could pass the value of X to Test() from
Key-In,
Say, 'VBA RUN Test 123' ?
There was another way in Microstation Basic Macro using Command$
function (command line argument), but VBA doesn't seems supporting
Command$ Function.
Thanks,
Vikas
Continue reading on narkive:
Search results for 'VBA Sub Procedure argument from Key-In ?' (Questions and Answers)
4
replies
Using macro, how do i refresh all worksheets in excel file?
started 2009-06-19 04:53:04 UTC
software
Loading...