Worksheet Name as argument in Custom Function

  • Thread starter Thread starter Larry D
  • Start date Start date
L

Larry D

Thanks, but sorry to say that made it worse. It doesn't
work with either the string name or a cell reference when
I use the "Evaluate" function.
 
YOu need to check what you have

Function Get_Data(rname, sname, row)
If TypeName(sname) = "Range" Then
sNm = sname.Value
Else
sNm = sname
End If
Get_Data = Sheets(sNm).Range(rname).Cells(row)
End Function


both of these worked for me:
=Get_Data($C4,"Data_Sheet",$E4)

=Get_Data($C4,$D4,$E4)
 
Back
Top