What optional arguments do you always explicitly declare?

MrKowz

Well-known Member
Joined
Jun 30, 2008
Messages
6,653
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
In the neverending process of finding "good" programming habits, I am wanting to know what optional arguments anyone always explicitly declares, and why.

I find myself always declaring the last argument of a VLOOKUP, even when I am using the TRUE argument. I like to explicitly state this argument so that it is easier when I go back to look at my formulas, I can quickly and easily see whether I am wanting an exact or closest match.
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
I generally pass all arguments, for the same reason (so I know what I intended when I wrote the formula).

Aside from that, sometimes I think I interpret formulas better when I see the arguments I expect to find - i.e., consistency/habit/old dog stuff. I've had to do double takes on IF() formulas posted here, when there's no "False" arguments - just looks so strange to me that at first I think its plain wrong. Another one I can never get used to is Left(A1) instead of Left(A1,1) And since that doesn't work in VBA I just stick to the two argument version and don't think about it much.

I've seen some threads to the effect that Excel will perform better if some arguments are not left implicit - for example, the Column Argument for an Offset() formula, such as you might put in a dynamic named range. But as with formulas, once I find a way that works, I usually stick to it.
 
Last edited:
i use vba almost exclusively and whilst i tend to complete all arguments, there are times when it is just plainly rediculous (eg the full msgbox() function).
 
i use vba almost exclusively and whilst i tend to complete all arguments, there are times when it is just plainly rediculous (eg the full msgbox() function).

I also try and be explicit when using VBA functions. With VBA functions I try to always refer to the argument by name, e.g:

Code:
Msgbox Prompt:="Hello World", Buttons:= vbOkOnly+vbInformation

There are instances where you cannot do this, such as:
Code:
Unload Object:=Me 'fails
Unload Me 'works
 

Forum statistics

Threads
1,223,760
Messages
6,174,339
Members
452,555
Latest member
colc007

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