#### Taking multiple parameters

```I am running a query inside my macro that creates a worksheet full of
some info. I want users to be able to take the results of one macro,
and use it as arguments for another macro. So lets say I run 1 macro,
I get 2 user ids as a result, say: 1, 2

Now I want to use these user ids as input parameters. Keep in mind
these input parameters might vary.

So how do I supply these as parameters to another macro?
```
 0
9/5/2008 4:02:04 PM
excel 39879 articles. 2 followers.

1 Replies
606 Views

Similar Articles

[PageSpeed] 7

```Pass the calculated or retreived values as parameters to the second macro:

Sub Macro1()
IDValue1 = "ID 123"
IDValue2 = "ID 456"
Macro2 IDValue1, IDValue2
End Sub

Sub Macro2(varVal1 As Variant, varVal2 As Variant)
MsgBox "I just got the values " & varVal1 & " and " & varVal2
End Sub

HTH,
Bernie
MS Excel MVP

>I am running a query inside my macro that creates a worksheet full of
> some info. I want users to be able to take the results of one macro,
> and use it as arguments for another macro. So lets say I run 1 macro,
> I get 2 user ids as a result, say: 1, 2
>
> Now I want to use these user ids as input parameters. Keep in mind
> these input parameters might vary.
>
> So how do I supply these as parameters to another macro?

```
 0
Bernie
9/6/2008 2:15:27 AM

Similar Artilces:

Multiple IF & VLOOKUP functions
This formula below works as shown =IF(D10=0.5,(VLOOKUP(I10,Table_A,2,0))). the result is shown in 'J10' But 'D10' has 9 possibilities and 'I10' has to look up 9 tables; Table_A through Table_I which are in sheet three. for each possibility there is a table for the answer. Can someone help with this please. Thanks in advance One way: =VLOOKUP(I10, INDIRECT(VLOOKUP(D10, \$M\$1:\$N\$9,2)),2,FALSE) where M N 1 0.5 Table_A 2 0.74 Table_B 3 ... In article <7322915E-4927-45B1-B874-4F710A816823@mi...

How get Multiple seperate accounts?
I had to do a major re install of everything. I have several accounts that I use Outlook for. It used to be each time I would start Outlook, it would ask me which account to use. It would save a .pst for that account uniquely. Now it just opens and downloads all email to inbox from every account and it setup for. How can I set up Outlook so that it can have several account and asks which account to use for a session? I say in help something to do with XP user accounts but I want one XP user to have several OUtlook accounts. Any help on this frustrating situtation greatly appreciated. ...

How do I print multiple charts on one page?
I've got all of my graphs in different sheets, but I can't figure out how to print 2 per page. Is there any possible way to do this?! Embed the charts onto a single worksheet. If the charts are on separate chart sheets (no underlying cells), right click the chart and select Location, and choose the target sheet from the As Object In dropdown. If the charts are embedded on different worksheets, copy each and paste it onto a single worksheet. Finally, print out the worksheet with all of the charts. - Jon ------- Jon Peltier, Microsoft Excel MVP Tutorials and Custom Solutions Pelt...

How to allow multiple users to update workbook (on network)?
How can I let multiple users update a single worksheet over a network? e.g. how can I let different users simultaneously (on a network) add new rows to existing rows of data? I know there's a function called Share Workbook under the Tools menu. What happens if two users attempt to add data to row 10? How do I deal with a situation where a user has added data to a row e.g. row 10; and another user seeing row 10 as blank and attempts to add data to row 10? Note: VBA Answers are also welcome :) -- quddusaliquddus -----------------------------------------------------------------------...

pivot table with multiple instances
i'm currently dealing witha pivot table that has column fields and row fields and is displaying the the "count" of a field. this is displaying numbers other than 0 and 1 as it should, but i was wondering if there is a way to somehow display all of the actual values. for example: apple no tuesday apple yes monday apple no wednesday orange yes thursday orange yes friday pear no saturday making a pivot table of this with the frute as the column field, yes/no as the row field, and day as the data, you'll notice that oran...

Bookmarks take me away from email
I use "Actions > Send Web Page by E-mail". Then setup the bookmark, and a link to the bookmark in Outlook. This link takes the recipient to the web page (www.webpage.com#bookmark), rather than jumping them to that part of the email. It seems like this should be possible since you can set the link to go to a bookmark. I don't even get how it thinks I would possibly want it to go to a web page. Help is much appreciated! ...

Multiple Outgoing Messages
Recently, Outlook 2002 (Internet Mail Only) clients on our LAN have begun to intermittently send outgoing messages repeatedly. In most, but not all, instances the messages have attachments, and take an unusually long time to send before showing a "Complete" Send/Receive status. The messages then remain in the Outbox, and are sent multiple times before finally clearing themselves or being manually deleted. Any insights into this would be greatly appreciated. Thanks, lewis. Hi, It seems like you've gotten a virus of some kind. There's no harm in running an an antivi...

multiple progressbar with backgroundworker
hello, i'm having problems getting my three progressbar getting updates. i created the backgroundworker and enabled the "WorkerReportsProgress = true". i specified the 3 progressbars in the "private void bgWorker_ProgressChanged(object sender, ProgressChangedEventArgs e)". the back ground worker calls a function, that function is doing construction of a multiple collection so i want to give the user progress via the progressbar. but i'm not getting the progressbar to show any progress. originally i had "private void ListLDN_Start(string[] fi...

multiple criteria
I am trying to create queries to sort church membership data according to any number of ministry groups (out of a possible 56) they volunteer for. My goal is to create a report for each of the Ministry's with name and contact information. I have some questions with corresponding database description information that will hopefully enable an expert to point me in the right direction... Questions: (1) I am at the query step and am looking for a way to link up the ministry with the corresponding FName. I have entered a ministry name in the criteria cells (e.g., "Choir") for all 28 c...

Take Ownership
What does it mean to Take Ownership of a file or folder? <PeoplesChoice@Chicago.net> wrote in message news:gjqqv5ddgj7uesie7vdej1tshbv49unr1u@4ax.com... > What does it mean to Take Ownership of a file or folder? It means to transfer ownership of an object from the original owner to you, (your account). Google ' Take Ownership ' for more information. To take ownership of a file or a folder How to take ownership of a file You must have ownership of a protected file in order to access it. If another user has restricted access and you are the computer administ...

Multiple Versions
I have 3 versions of Access on my developer machine (97, 2000 and XP). All were working fine until today. While working in an XP project, Access bombed. It indicated I should look for updates, which I did. The Office Updates web site walked me through a few security updates for XP, and then it attempted SP-3 for Office 2000. When the SP-3 update finishes, it searches for further updates, and keeps coming up with SP-3, as if it doesn't recognize that it was already installed. So, I say forget it, let's get back to work. I attempt to launch my XP project, and I get "T...

Amending multiple file names
I need to amend the filenames of an enormous number of files, e.g. <filename 091.doc> to <filename 0901.doc>. Can anyone suggest a quick way of doing this (or point me to instructions on the web)? -- Bagwash Do a google search for file renamers or bulk file renamers - there are some apps out there that can help with that task. Bagwash wrote: > I need to amend the filenames of an enormous number of files, e.g. > <filename > 091.doc> to <filename 0901.doc>. > Can anyone suggest a quick way of doing this (or point me to instructions &...

calculation taking too long
Currently I have a sheet where I enter my data and then another sheet within the same workbook that makes various calculations based on this data. But every time I enter data, it takes a long time for my formulas to calculate, upwards of a minute. I am pretty sure this is because my formulas contain entire columns as ranges (i.e. A:A rather than A1:A100). However I need to use A:A in my formulas as my data sheet is indefinitely long and I will continue to add to this over the years. I don't want to have to go back and change all my formulas to A1:A200 every time my data e...

Changing Query Filter for multiple Queries
I am working with several databases that each have 20+ different queries. Most of the queries have the same filter (like 200*)to restrict only the dates after 12/31/1999. In 2010, however, the queries do not pick up any of the data for 2010. Therefore, all of the queries that use that filter need to be changed. Is there any way to handle this change systematically? Thanks so much On Mon, 18 Jan 2010 15:39:01 -0800, SDamico <SDamico@discussions.microsoft.com> wrote: >I am working with several databases that each have 20+ different queries. >Most of the queries have...

Logging in taking too long
Why do SOME users' computers on my network take an unusual amount of time to log onto the network? I'm talking 15-20 min long! Not all of them too! This all started when we brought our server to our Austin office, due to Hurricane Rita, and brought it back to the gulf coast. When we brought it to Austin, we had to change settings (don't know what settings); then once we came back... there are some users who take forever to get on the server. Please help. Thank you, -- lfheb Have you checked event logs on both the client and the server? There has to be something in t...

Multiple messages for single selection change in list control
Hi, In the handler of LVN_ITEMCHANGING (OnItemChanging...()), how can I deduce which messages belong to the same event? I am interested in the change of an item selection state, but it seems that an irregular number of messages are sent for one such event. In some cases I would like to substitute *pResult = TRUE in order to cancel the change, but I still receive the rest of the messages for that same event. For those messages I should also set *pResult = TRUE, but how can I know which messages belong to the same event? I cannot figure out the logic of the number of messages sent for a single ...

Multiple signatures for multiple accounts
I've set up 2 signatures for 2 separate accounts, and assigned them to the appropriate accounts. Whenever I click on "NEW" for a new message, it uses the default account and default signature. If I want to change accounts I click "Accounts" and select the account I want, but the default signature stays on the message, and I have to manually delete it and insert the one from the account the message is now using. How can I change this ? Thanks al The feature you're interested in requires Word 2003 as the mail editor = -- Tools | Options | Mail Format. --=20 Sue ...

How to mail merge multiple rows in one document 03-10-10
Hi, I have a worksheet that lists subscribers of a service. It looks something like this: Organization Name Title Email ACME CO. Smith, Sam CEO ssmith@acme.com ACME CO. Jones, Bill Staff bjones@acme.com Each organization has one president and multiple staff members listed (between 1 and 5 staff members). I want to email each president, through mail merge, and give them a list of all the current subscribers from their organization (data from other rows in the worksheet). Is this possible to do (using Office 2...

Stop multiple Spam with Shift key
I'm using Outlook98 on an NT4 Exchange 5.5 Mail Server. If I right-click on a single Spam email in the In-box, at the bottom of the drop-down list, it has 'Junk E-mail' which gives the two options; 'Add to Junk Senders list' 'Add to Adult Content Senders list' When I click on 'Add to Junk Senders list', I will see this e-mail address in the 'Organise Inbox', and view 'Edit Junk Senders'. Often I have a number of Junk E-mails. If I select a few with the 'Shift' key and right-click, I am presented with a slightly different option. At ...

Multiple Extender Windows (one pop up, one not)
I am trying to set up two extender windows off of the sales order. One window will have mandatory customer order detail and will launch when the customer number is enetred. The other, has information for a specific customer-order type and I want them to be able to access it from the Additional menu. What is happenning, though, when I establish the two windows and set one to auto launch and one to be shortcut accessed, is both windows launch at the time I tab out of the customer field. Is there an easy way to segregate these windows or is this a natural shortcoming in Extender? Thanks f...