Hello all,
I have a code that copies values from specific cells in a specific sheet to the relevant bookmarks of a word document. The code is shown below:
Sub Procedure1()
Dim objWord As Object
Dim ws As Worksheet
Set ws = ThisWorkbook.Sheets("Sheet6")
Set objWord = CreateObject("Word.Application")
objWord.Visible = True
objWord.Documents.Open "C:\Users\Christopher.Ellis\Test1.docx" ' change as required
With objWord.ActiveDocument
.Bookmarks("CN1").Range.Text = ws.Range("C25").Value
.Bookmarks("CN2").Range.Text = ws.Range("C25").Value
.Bookmarks("CNo1").Range.Text = ws.Range("C26").Value
.Bookmarks("Cl1").Range.Text = ws.Range("C27").Value
.Bookmarks("Ex_1").Range.Text = ws.Range("C28").Value
.Bookmarks("Ex_2").Range.Text = ws.Range("C28").Value
.Save
.Close
End With
Set objWord = Nothing
End Sub
The code works fine, however when posting one of the values the font changes size, as opposed to what size it is on excel or on the Word document. In addition to this, some percentages that are shown in cells as 15.6% for example are appearing in the word document as 15.5742341313232%.
My question is, how do I amend my code so that the font appears how I want it to and so that the percentages appear to 2 decimal places?
Any assistance appreciated.
Bookmarks