Passing Arguments

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
Very beginner question: what does it mean to "pass arguments"?

It means you can use the result of one function as an argument in another function.

Ie: Function A performs some calculation and returns it's result. Sometimes you want this to run all by itself.

Now, you add Function B that does some other calculation, you can pass the result of Function A to Function B so it can run different calculations.

Of course, this is not limited to just numerical arguments.

Or, you have a sub with some variables, and you have Function A that performs some calculation. The sub can define it's variables and then pass those values to Function A if called from the sub and use those values for it's purposes.
 
Upvote 0
In addition to dreid1011's comments, I'd also note that you are passing arguments when you call most Excel functions.

For example, in the formula: =MAX(A1,B1) you are passing two range arguments to the MAX function.

If you look at Excel's Help for the MAX function, you'll see the syntax is MAX(number1, [number2], ...), and there are rules applied to the arguments number1, number2, ... etc, i.e.

- number1 is required, number2 ... number 255 are optional.
- Arguments can be numbers, names, arrays or range references containing numbers.

If you start coding with VBA, you can create your own customised functions that might need particular arguments. So when your code calls these functions, you will pass the arguments that you want the function to use, i.e. in the same way you call the MAX function in Excel with the arguments you want used.
 
Upvote 0

Forum statistics

Threads
1,215,472
Messages
6,125,005
Members
449,203
Latest member
Daymo66

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top