Thanks for that, chance is very small my users will come across that bug,
but you never know.
Didn't know you could use Type:=0 argument and still pick the range up.
I will go for the second work-around then.
I used something similar (parsing out the sheet from the range address)
before
I knew about rng.Parent:
Function GetSheetFromRange(rng As Range) As Worksheet
Dim lPos1 As Long
Dim lPos2 As Long
Dim strAddress As String
Dim strSheet As String
strAddress = rng.Address(, , , True)
lPos1 = InStr(1, strAddress, "]")
lPos2 = InStr(1, strAddress, "!")
strSheet = Mid$(strAddress, lPos1 + 1, (lPos2 - lPos1) - 1)
'not sure why the single quote is there sometimes and sometimes not
'------------------------------------------------------------------
If Right$(strSheet, 1) = Chr(39) Then
strSheet = Left$(strSheet, Len(strSheet) - 1)
End If
Set GetSheetFromRange = Sheets(strSheet)
End Function
RBS
Peter T said:
For completeness might want to do
rng.Parent.Parent.Activate
rng.Parent.Activate
Just in case, there's a bug with Type:=8 on sheets with certain types of
CF, two workarounds here
http://www.jkp-ads.com/Articles/SelectARange.asp
Regards,
Peter T