View Single Post
 
Old 10-12-2015, 03:21 AM
dougie1809 dougie1809 is offline Windows 7 64bit Office 2010 32bit
Novice
 
Join Date: Oct 2015
Posts: 4
dougie1809 is on a distinguished road
Thumbs up

Quote:
Originally Posted by macropod View Post
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
Reply With Quote