View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Chip Pearson Chip Pearson is offline
external usenet poster
 
Posts: 7,247
Default optional argument in a function

Try something like the following:


Function Test(Optional X As Variant) As Integer
If IsMissing(X) Then
Test = 0
Else
Test = X + 1
End If
End Function

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



"visitor" wrote in message
...
hi,

can anyone advise as to how do i use an optional argument in a
function?

thanks in advance