Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default How To add Hyperlink to all files in a folder

I have more than 700 pdf files in a folder.How i hyperlink all files
in one go?


Thanks in advance for help
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,501
Default How To add Hyperlink to all files in a folder

Hi,

Try this code. If you have files other than PDF and you dont want those
files use this line

Dir(MyPath & "*.Pdf")
in place of
activefile = Dir(MyPath)

Sub Add_Links()
Dim x As Long
x = 1
Application.DisplayAlerts = False
'Change this to your directory
MyPath = "C:\"
activefile = Dir(MyPath)
Do While activefile < ""
ActiveSheet.Hyperlinks.Add Anchor:=Cells(x, 1), _
Address:=MyPath & activefile, TextToDisplay:=activefile
activefile = Dir()
x = x + 1
Loop
Application.DisplayAlerts = True
End Sub

Mike

"Salman Qureshi" wrote:

I have more than 700 pdf files in a folder.How i hyperlink all files
in one go?


Thanks in advance for help
.

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,501
Default How To add Hyperlink to all files in a folder

I meant

use this line
activefile = Dir(MyPath & "*.Pdf")
instead of
activefile = Dir(MyPath)

Mike

"Mike H" wrote:

Hi,

Try this code. If you have files other than PDF and you dont want those
files use this line

Dir(MyPath & "*.Pdf")
in place of
activefile = Dir(MyPath)

Sub Add_Links()
Dim x As Long
x = 1
Application.DisplayAlerts = False
'Change this to your directory
MyPath = "C:\"
activefile = Dir(MyPath)
Do While activefile < ""
ActiveSheet.Hyperlinks.Add Anchor:=Cells(x, 1), _
Address:=MyPath & activefile, TextToDisplay:=activefile
activefile = Dir()
x = x + 1
Loop
Application.DisplayAlerts = True
End Sub

Mike

"Salman Qureshi" wrote:

I have more than 700 pdf files in a folder.How i hyperlink all files
in one go?


Thanks in advance for help
.

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
Pulling pdf files from general folder to specific folder [email protected] Excel Discussion (Misc queries) 2 September 8th 09 09:41 PM
Hyperlink files same folder only? dahljam Excel Discussion (Misc queries) 2 July 3rd 07 07:00 PM
Copying all files in a folder to new folder michaelberrier Excel Discussion (Misc queries) 2 June 20th 06 05:35 AM
Hyperlink from 1 folder to another? Nicola New Users to Excel 0 February 4th 06 02:35 PM
how can I specific a folder with wildcard criteria and excel will import all the correct files in that folder? Raven Excel Discussion (Misc queries) 1 January 24th 06 03:28 PM


All times are GMT +1. The time now is 07:02 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"