Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default HYPERLINKING PDF FILES HAVING NAMES IN COLUM TO A PDF FILE IN A FO

I have around 150000 PDF files to hyperlink in excel from a folder. I have
put the file name in Column A. The file names of PDF file are same as in
Column A. Is there any function or macro which can hyperlink the files.

Can any one help me out of this problem.
--
COOLGUY_IVRCL
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,522
Default HYPERLINKING PDF FILES HAVING NAMES IN COLUM TO A PDF FILE IN A FO

Instead of the overhead of hyperlinks try this
Right click sheet tabview codeinsert thismodify your path to suit
Then, assuming you have
myfile typed in a cell and you double click on it the file in yourfolder
will open

Private Sub Worksheet_BeforeDoubleClick _
(ByVal Target As Range, Cancel As Boolean)
ActiveWorkbook.FollowHyperlink Address:= _
"\yourfoldernamehere\" & Target.Value & ".pdf"
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

<COOLGUY_IVRCL wrote in message
...
I have around 150000 PDF files to hyperlink in excel from a folder. I have
put the file name in Column A. The file names of PDF file are same as in
Column A. Is there any function or macro which can hyperlink the files.

Can any one help me out of this problem.
--
COOLGUY_IVRCL


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,203
Default HYPERLINKING PDF FILES HAVING NAMES IN COLUM TO A PDF FILE IN A FO

If you've got 150,000 files listed in one sheet, I assume you're using Excel
2007 or 2010?
This code will take the entries in column A starting with whatever cell you
define in the code as 'firstName' in the code on to the end of the list (or
1st empty cell) and turn it into a hyperlink.

The code assumes that either the full path to the .pdf file(s) is part of
the entry in column A, or that they're all in a single folder somewhere.

If the full path is in the cell as part of the .pdf name, then use the line
of code that reads Const basePath = "", deleting the one that now reads
Const basePath = "C:\SomeFolder\AnotherFolder\PDFFiles\"

But if you need to add the path, then use that last one, changing the path
as required, and delete the 'Const basePath = "" line from the code.

Make a copy of your workbook, and test the code in the copy!

To put the code into your workbook: Open the workbook, press [Alt]+[F11]
and then choose Insert -- Module and copy the code and paste it into the
module presented to you. Then edit the code as needed to change/set the
values of firstName and basePath to meet your needs. Then close the VB
Editor. Choose the sheet with the files listed and use
Tools--Macro--Macros and choose the MakeHyperlinks macro and click the
[Run] button.


Sub MakeHyperlinks()
Dim listOfFiles As Range
Dim anyFile As Range
'set this next value to the
'address with the first .pdf
'filename in it
Const firstName = "A2"
'if you don't have the full path
'to the .pdf files in the cells
'in column A, then use this line
'of code
'changing the path as required
Const basePath = "C:\SomeFolder\AnotherFolder\PDFFiles\"
'but if the paths are already in the cells, then
'use this line of code instead
' remove the ' at the start of it to make it
' an active command, and remove the
' previous definition of basePath
'Const basePath = ""


Set listOfFiles = ActiveSheet. _
Range(firstName & ":" & _
ActiveSheet.Range(firstName).End(xlDown).Address)
For Each anyFile In listOfFiles
ActiveSheet.Hyperlinks.Add Anchor:=anyFile, _
Address:=basePath & anyFile.Value, _
TextToDisplay:=anyFile.Value
Next
Set listOfFiles = Nothing
End Sub


"COOLGUY_IVRCL" wrote:

I have around 150000 PDF files to hyperlink in excel from a folder. I have
put the file name in Column A. The file names of PDF file are same as in
Column A. Is there any function or macro which can hyperlink the files.

Can any one help me out of this problem.
--
COOLGUY_IVRCL

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,203
Default HYPERLINKING PDF FILES HAVING NAMES IN COLUM TO A PDF FILE IN

Very nice, I like that and hadn't even thought about such a method.

If the OP then formatted column A as underlined blue text, they'd even look
like hyperlinks.

"Don Guillett" wrote:

Instead of the overhead of hyperlinks try this
Right click sheet tabview codeinsert thismodify your path to suit
Then, assuming you have
myfile typed in a cell and you double click on it the file in yourfolder
will open

Private Sub Worksheet_BeforeDoubleClick _
(ByVal Target As Range, Cancel As Boolean)
ActiveWorkbook.FollowHyperlink Address:= _
"\yourfoldernamehere\" & Target.Value & ".pdf"
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

<COOLGUY_IVRCL wrote in message
...
I have around 150000 PDF files to hyperlink in excel from a folder. I have
put the file name in Column A. The file names of PDF file are same as in
Column A. Is there any function or macro which can hyperlink the files.

Can any one help me out of this problem.
--
COOLGUY_IVRCL


.

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
Seeing Text File Names when Saving Excel Files jkiser New Users to Excel 4 January 1st 09 01:57 PM
Hyperlinking to External Files Rebecca New Users to Excel 2 October 27th 07 02:42 AM
HyperLinking PDF files in Excel kelly.day New Users to Excel 1 February 25th 07 08:31 AM
Excel 2003 - When I open files, why are some file names blue? Formula One Excel Discussion (Misc queries) 2 August 17th 06 05:58 PM
Hyperlinking pdf files Kiwi Girl New Users to Excel 2 November 23rd 05 08:17 AM


All times are GMT +1. The time now is 04:48 PM.

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

About Us

"It's about Microsoft Excel"