Hi,
I am trying copy numbers from excel to bookmarked locations in word. I have managed to do the copying. I would like to format the numbers in word to (#,###.00) but don't know how. Does anyone know?
Thanks, Rick.
my codes are:
Sub OpenWordDoc()
Dim wdapp As Word.Application
Dim wddoc As Word.Document
Dim wdrange As Word.Range
Dim aaa As Excel.Range
Dim bbb As Excel.Range
Set aaa = Sheets("sheet1").Range("B2")
Set bbb = Sheets("sheet1").Range("E2")
Set wdapp = CreateObject("Word.Application")
If Err.Number <> 0 Then
Set wdapp = CreateObject("word.application")
End If
On Error GoTo 0
Set wddoc = wdapp.Documents.Open("C:\Documents.docx")
wdapp.Visible = True
Set wdrange = wddoc.Goto(what:=wdGoToBookmark, Name:="aaa")
wdrange.Text = aaa
End Sub
I am trying copy numbers from excel to bookmarked locations in word. I have managed to do the copying. I would like to format the numbers in word to (#,###.00) but don't know how. Does anyone know?
Thanks, Rick.
my codes are:
Sub OpenWordDoc()
Dim wdapp As Word.Application
Dim wddoc As Word.Document
Dim wdrange As Word.Range
Dim aaa As Excel.Range
Dim bbb As Excel.Range
Set aaa = Sheets("sheet1").Range("B2")
Set bbb = Sheets("sheet1").Range("E2")
Set wdapp = CreateObject("Word.Application")
If Err.Number <> 0 Then
Set wdapp = CreateObject("word.application")
End If
On Error GoTo 0
Set wddoc = wdapp.Documents.Open("C:\Documents.docx")
wdapp.Visible = True
Set wdrange = wddoc.Goto(what:=wdGoToBookmark, Name:="aaa")
wdrange.Text = aaa
End Sub