Quote:
Originally Posted by macropod
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
|
Thank you again for your reply. My mistake for the confusion, I was suppose to say it will be referring to different text per line.
However your macro worked really well. I can now use that as an icon in Word.
Kind regards,
Doug