Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I have more than 700 pdf files in a folder.How i hyperlink all files
in one go? Thanks in advance for help |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Pulling pdf files from general folder to specific folder | Excel Discussion (Misc queries) | |||
Hyperlink files same folder only? | Excel Discussion (Misc queries) | |||
Copying all files in a folder to new folder | Excel Discussion (Misc queries) | |||
Hyperlink from 1 folder to another? | New Users to Excel | |||
how can I specific a folder with wildcard criteria and excel will import all the correct files in that folder? | Excel Discussion (Misc queries) |