Quote:
Originally Posted by dougie1809
Thank you for your reply. The cells do not contain the same text, they contain different PDF file names.
|
If you want help solving a problem, you should avoid providing misleading information. While you now say the cells don't contain the same text, the table in your attachment does contain the same text in every cell in column 2.
Hopefully, you have now correctly stated your requirements, for which you could use a macro like:
Code:
Sub Demo()
Dim Rng As Range, TblCell As Cell, StrTxt As String
With Selection
If .Information(wdWithInTable) = False Then Exit Sub
For Each TblCell In .Cells
Set Rng = TblCell.Range
With Rng
.End = .End - 1
StrTxt = .Text
.Text = ""
End With
ActiveDocument.Hyperlinks.Add Anchor:=Rng, _
Address:="Address", SubAddress:="SubAddress", _
ScreenTip:="", TextToDisplay:=StrTxt, Target:="_blank"
Next
End With
End Sub