Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default Parameter in Macro Call?

I have my macro all set to format a report. The last thing I had to do was
pass in the date of the report since the ETL happens elsewhere. So, when I
took:

Sub LoadData()

and changed it to

Sub LoadData(dt As String)

the macro name disappeared from my run macro list and the script that calls
it can't see it either. Is there some way to pass a parameter into a macro
like this?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,119
Default Parameter in Macro Call?

To get a parameter passed in remove the argument you have added and add some
code to prompt for a value similar to this

Sub LoadData()
dim dt as string

dt = inputbox("Please enter the date")

--
HTH...

Jim Thomlinson


"kmbarz" wrote:

I have my macro all set to format a report. The last thing I had to do was
pass in the date of the report since the ETL happens elsewhere. So, when I
took:

Sub LoadData()

and changed it to

Sub LoadData(dt As String)

the macro name disappeared from my run macro list and the script that calls
it can't see it either. Is there some way to pass a parameter into a macro
like this?

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Parameter in Macro Call?

You can still run it from the macro dialog box, even though it
will not show up in the list. In the Macro Name box, enter
'LoadData "the string" '


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com




"kmbarz" wrote in message
...
I have my macro all set to format a report. The last thing I
had to do was
pass in the date of the report since the ETL happens elsewhere.
So, when I
took:

Sub LoadData()

and changed it to

Sub LoadData(dt As String)

the macro name disappeared from my run macro list and the
script that calls
it can't see it either. Is there some way to pass a parameter
into a macro
like this?



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Parameter in Macro Call?

It will disappear from the list as these are macros that you can run without
supplying parameters, there is no way to supply parameter values from there.

That should not stop you using it from another procedure though, just ensure
that you pass the parameter.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"kmbarz" wrote in message
...
I have my macro all set to format a report. The last thing I had to do

was
pass in the date of the report since the ETL happens elsewhere. So, when

I
took:

Sub LoadData()

and changed it to

Sub LoadData(dt As String)

the macro name disappeared from my run macro list and the script that

calls
it can't see it either. Is there some way to pass a parameter into a

macro
like this?



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro for Parameter Query bchan[_3_] Excel Programming 0 October 19th 04 08:08 AM
Macro for Parameter Query bchan[_2_] Excel Programming 1 October 18th 04 05:00 PM
Macro for Parameter Query bchan Excel Programming 1 October 18th 04 11:31 AM
is there a maximum size of parameter for a (Fortran)DLL call from VBA tilmP Excel Programming 0 April 26th 04 02:41 PM
Parameter Query executed from a Macro David Excel Programming 4 April 19th 04 11:37 PM


All times are GMT +1. The time now is 10:10 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"