View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Rob van Gelder[_4_] Rob van Gelder[_4_] is offline
external usenet poster
 
Posts: 1,236
Default Testing if Variant is Range or Double?

Don,

Sub test()
Dim var As Variant

var = CDbl(123.456)
' Set var = Range("A1")
If TypeOf var Is Range Then MsgBox "It's a range" Else MsgBox "It's not
a range"
End Sub

Rob

"Don Wiss" wrote in message
...
So I rewrote my interpolation function to take in input as a numeric array
that can be either in Option Base 0 or 1. It is a Variant. Is there some
way I can tell if this input is a range instead of numeric? Then I can
convert it to values and make this new function also handle the argument
that the exisiting function takes. And so replace it.

Don <donwiss at panix.com.