Problems with If function

L

Linck Schlich

I have successfully used the following to create a dynamic link:

=HYPERLINK(INDIRECT("'" & $A$12 & "'" & "!" & "A2"))

The problem is that if there is no value in the cell referenced for
the dynamic link, it returns that annoying #ref!
So, I thought I would be smart, and change it to:

=IF(A12="","",HYPERLINK(INDIRECT("'" & $A$12 & "'" & "!" & "A2")))

This got of the #ref!, sure enough, but now, gives an error and says
that the reference is invalid.

Thoughts?
 
G

GS

Linck Schlich was thinking very hard :
I have successfully used the following to create a dynamic link:

=HYPERLINK(INDIRECT("'" & $A$12 & "'" & "!" & "A2"))

The problem is that if there is no value in the cell referenced for
the dynamic link, it returns that annoying #ref!
So, I thought I would be smart, and change it to:

=IF(A12="","",HYPERLINK(INDIRECT("'" & $A$12 & "'" & "!" & "A2")))

This got of the #ref!, sure enough, but now, gives an error and says
that the reference is invalid.

Thoughts?

Try checking the INDIRECT function with ISERROR()...


=IF(ISERROR(INDIRECT("'"&$A$12&"'!A2")),"",HYPERLINK(INDIRECT("'"&$A$12&"'!A2")))
 
L

Linck Schlich

Linck Schlich was thinking very hard :







Try checking the INDIRECT function with ISERROR()...

=IF(ISERROR(INDIRECT("'"&$A$12&"'!A2")),"",HYPERLINK(INDIRECT("'"&$A$12&"'! A2")))

--
Garry

Free usenet access athttp://www.eternal-september.org
ClassicVB Users Regroup! comp.lang.basic.visual.misc

That worked beautifully!! Thank you so much.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top