Hi!
I' ve written a procedure that takes following formal parameters
Private Sub FetchInfo(ByRef InfoSource As Range, ByRef InfoTarget As Range, Optional ByVal DetailField As Range = Range("IV65536"))
The Help says that :
Note IsMissing does not work on simple data types (such as Integer or Double) because ....
so I can't use IsMissing function to test the optional argument. It recommends to use a "specialvalue" like this :
Sub MySub(Optional MyVar As String = "specialvalue")
If MyVar = "specialvalue" Then
' MyVar was omitted.
Else
...
End Sub
But the compiler fails in my procedure and says that -Range("IV65536")- statement is not constant.
How can I test an optional range object if it is passed as an argument or not?
Thanks...
I' ve written a procedure that takes following formal parameters
Private Sub FetchInfo(ByRef InfoSource As Range, ByRef InfoTarget As Range, Optional ByVal DetailField As Range = Range("IV65536"))
The Help says that :
Note IsMissing does not work on simple data types (such as Integer or Double) because ....
so I can't use IsMissing function to test the optional argument. It recommends to use a "specialvalue" like this :
Sub MySub(Optional MyVar As String = "specialvalue")
If MyVar = "specialvalue" Then
' MyVar was omitted.
Else
...
End Sub
But the compiler fails in my procedure and says that -Range("IV65536")- statement is not constant.
How can I test an optional range object if it is passed as an argument or not?
Thanks...