Hi all,
I am new here and new to VBA coding. I am using and modifying an Excel VBA subroutine that generates a Word document with tables populated with information. Now I'm looking to add a snipet of code that lets me turn text in selected cells into hyperlinks.
This is what imo relevant parts of the current code look like:
(...)
Dim wrdApp As Word.Application
Dim wrdDoc As Word.Document
(...)
Set wrdApp = CreateObject("Word.Application")
Set wrdDoc = wrdApp.Documents.Add
wrdDoc.PageSetup.Orientation = wdOrientLandscape
(...)
Set objTable = wrdDoc.Tables(wrdDoc.Tables.Count)
objTable.Style = "Table Grid"
(...)
With objTable
.Cell(2, 2).Range.Text = Chr(10) & "TEXT A"
.Cell(2, 2).Range.Font.Bold = True
.Cell(4, 2).Range.Text = "TEXT B"
.Cell(4, 2).Range.Font.Bold = True
(...)
Now I'd like to encode that e.g. hyperlink X is added to TEXT A in Cell (2,2).
Does someone know which code to use?
Bookmarks