you are welcome.
please don't quote previous messages.
James Douglas "Jim" Morrison (December 8, 1943 – July 3, 1971) was an American singer, songwriter and poet best remembered as the lead singer of The Doors.
https://en.wikipedia.org/wiki/Jim_Morrison
and 'This is the End' is one of the greatest songs they have produced.
mancubus is fine. it's taken from id software's famous game series, Doom.
after recording the macro did you test it. i mean when you clicked the hyperlink in a cell did it open the linked file?
%20's mostly stand for space character.
from the recorded macro, i understand that
A1 = RFI PDF\RFI - 001.pdf
A2 = RFI PDF\RFI - 002.pdf
...
A20 = RFI PDF\RFI - 020.pdf
and you want cells' hyperlinks displayed as RFI-001 (spaces removed) and not RFI - 001.pdf.
if this is the case, try
Sub vbax_55200_Insert_Hyperlinks_Cells_Contain_File_Names_With_Path()
Dim Text2Display As String
With ActiveSheet
For i = 1 To .Cells(.Rows.Count, 1).End(xlUp).Row
Text2Display = Replace(CreateObject("Scripting.FileSystemObject").GetBaseName(.Range("A" & i).Value), " ", "")
.Hyperlinks.Add Anchor:=.Range("A" & i), Address:=PdfFilesPath & .Range("A" & i).Value, TextToDisplay:="RFI-001"
Next
End With
End Sub
if cells contain only file names, like
A1 = RFI - 001.pdf
A2 = RFI - 002.pdf
...
A20 = RFI - 020.pdf
then try
Sub vbax_55200_Insert_Hyperlinks_Cells_Contain_File_Names_Only()
Dim PdfFilesPath As String, Text2Display As String
PdfFilesPath = "RFI PDF\"
'PdfFilesPath = "RFI%20PDF\"
With ActiveSheet
For i = 1 To .Cells(.Rows.Count, 1).End(xlUp).Row
Text2Display = Replace(CreateObject("Scripting.FileSystemObject").GetBaseName(.Range("A" & i).Value), " ", "")
.Hyperlinks.Add Anchor:=.Range("A" & i), Address:=PdfFilesPath & .Range("A" & i).Value, TextToDisplay:=Text2Display
Next
End With
End Sub