Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How to lookup hyperlinked cells

I want to hyperlink several cells to pdf files. Then want to use
lookup function to return a cell and then print both the current wor
sheet and the hyperlinked pdf file.

Can this be done?

thanks
nei

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 117
Default How to lookup hyperlinked cells

Your solution would have to include a UDF (user-defined function) to return
the hyperlink address contained in the cell that has a hyperlink in it. Try
the function below (I have been working on a more sophisticated version for
the Else portion of the clause that will return the URL if the Link argument
is a cell with a HYPERLINK function, but I don't have it fully debugged in
the case of a nested function, etc.).

Public Function HyperlinkURL(Link As Range) As Variant
With Link
If .Hyperlinks.Count 0 _
Then
'Return the URL of the hyperlink.
HyperlinkURL = .Hyperlinks(1).Address
Else
'Return #N/A! error value if none found.
HyperlinkURL = CVErr(xlErrNA)
End If
End With
End Function

After printing the current worksheet, you would then have to use the Shell
statement to execute a command line similar to the following
"C:\Program Files\Adobe\Acrobat 5.0\Reader\AcroRd32.exe" /p /h "%1" to print
out the PDF file, where "%1" would be replaced by the hyperlink address
returned by the function above.

I am assuming that you have a command button that you want to click to print
out the current worksheet, then fetch the address of the PDF document at the
active cell, then print that out. Technically, you can't do that with a
function. A function can only return a value to a cell, not perform actions
that would be carried out by a command macro.
--
Regards,
Bill


"neil kempinski " wrote in
message ...
I want to hyperlink several cells to pdf files. Then want to use a
lookup function to return a cell and then print both the current work
sheet and the hyperlinked pdf file.

Can this be done?

thanks
neil


---
Message posted from http://www.ExcelForum.com/



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Linking Hyperlinked Cells Trainer Excel Discussion (Misc queries) 3 May 29th 09 06:24 PM
Lookup returns hyperlinked values as normal text KarenF Excel Discussion (Misc queries) 16 October 29th 08 12:53 PM
How can I sort hyperlinked cells? Midjack Excel Discussion (Misc queries) 0 August 7th 08 04:12 PM
set hyperlinked cells to always display at the top of the workshee Valeria Excel Discussion (Misc queries) 3 October 26th 06 03:15 PM
locked hyperlinked cells Jared Excel Discussion (Misc queries) 0 October 16th 06 06:35 AM


All times are GMT +1. The time now is 08:07 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"