View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Fredrik Wahlgren Fredrik Wahlgren is offline
external usenet poster
 
Posts: 339
Default Cell validation problem


"Dick Kusleika" wrote in message
...
Fredrik

One way
Function MyRef(wb As String, ws As String, cell As String)


Dim rTest as Range

On Error Resume Next
Set rTest = ActiveSheet.Range(cell)
On Error Goto 0

If rTest Is Nothing Then
MyRef = "Invalid Cell Reference"
Else
MyRef = Application.Evaluate("[" + wb + ".xls]" + ws + "!" + cell)


End If

End Function


Yes, this seems to solve the problem. I have to admit that I thought there
was another way to do this, one that wouldn't result in a run time error.

Thank you,
Fredrik