Here's an example of something I use:
Function CurRound(amount As Variant, Optional nearest As Double) As Currency
If IsNumeric(amount) Then
If IsMissing(nearest) Then nearest = 0.01
CurRound = Int(amount / nearest + 0.5) * nearest
Else
CurRound = 0
End If
End Function
You can use multiple Optional arguments like:
Function Whatever(A As String, Optional B As Integer, Optional, C As Double)
You can skip places if you put a comma like:
Function Whatever("Arvin", , 2.003)
you do not need a comma if you use it like:
Function Whatever("Arvin", 2)
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com