View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Jacob Skaria Jacob Skaria is offline
external usenet poster
 
Posts: 8,520
Default Test for Optional and Asign one Range to another

rngOffset is declared twice as the function argument.
--
If this post helps click Yes
---------------
Jacob Skaria


"Michael" wrote:

Below is a snipit of a function I am having trouble with... I am
tyring to write a function that gets passed 1 or 2 ranges. I cant seem
to get the optional test to work right. Also how do I asign one range
to another. Basicly if only one range is passed to the fuction I want
to set the optional range equal to the one required range, Any help
would be appreciated it.
Thanks.

Function temp(rng As Range, rngoffset As Range, Optional rngoffset As
Variant)

If IsEmpty(rngoffset) Is True Then

Debug.Print "rngoffset empty"
Set rngoffset = rng
End If

End Function