I wrote a program to copy info from excel and put it into a word document. The only problem I'm having is keeping the formatting of the numbers. I have the code format the cells in excel and I have the text form fields in word formatted correctly, but when the numbers are transferred, the formatting is lost. Anyone have any ideas on how to fix this??? Thanks.
Here's a bit of the code:
Range("F9:J9").Select
Selection.NumberFormat = "#,##0.00"
Range("G10:K10").Select
Selection.NumberFormat = "#,##0.00"
Range("A1").Select
wdoc.ActiveWindow.Selection.Goto What:=wdGoToBookmark, Name:="PA1"
wdoc.ActiveWindow.Selection.TypeText ActiveSheet.Range("F9")
wdoc.ActiveWindow.Selection.Goto What:=wdGoToBookmark, Name:="PA2"
wdoc.ActiveWindow.Selection.TypeText ActiveSheet.Range("G9")
wdoc.ActiveWindow.Selection.Goto What:=wdGoToBookmark, Name:="PA3"
wdoc.ActiveWindow.Selection.TypeText ActiveSheet.Range("H9")
wdoc.ActiveWindow.Selection.Goto What:=wdGoToBookmark, Name:="PA4"
wdoc.ActiveWindow.Selection.TypeText ActiveSheet.Range("I9")
wdoc.ActiveWindow.Selection.Goto What:=wdGoToBookmark, Name:="PA5"
wdoc.ActiveWindow.Selection.TypeText ActiveSheet.Range("J9")
wdoc.ActiveWindow.Selection.Goto What:=wdGoToBookmark, Name:="PA6"
wdoc.ActiveWindow.Selection.TypeText ActiveSheet.Range("G10")
wdoc.ActiveWindow.Selection.Goto What:=wdGoToBookmark, Name:="PA7"
wdoc.ActiveWindow.Selection.TypeText ActiveSheet.Range("H10")
wdoc.ActiveWindow.Selection.Goto What:=wdGoToBookmark, Name:="PA8"
wdoc.ActiveWindow.Selection.TypeText ActiveSheet.Range("I10")
wdoc.ActiveWindow.Selection.Goto What:=wdGoToBookmark, Name:="PA9"
wdoc.ActiveWindow.Selection.TypeText ActiveSheet.Range("J10")
wdoc.ActiveWindow.Selection.Goto What:=wdGoToBookmark, Name:="PA10"
wdoc.ActiveWindow.Selection.TypeText ActiveSheet.Range("K10")
Here's a bit of the code:
Range("F9:J9").Select
Selection.NumberFormat = "#,##0.00"
Range("G10:K10").Select
Selection.NumberFormat = "#,##0.00"
Range("A1").Select
wdoc.ActiveWindow.Selection.Goto What:=wdGoToBookmark, Name:="PA1"
wdoc.ActiveWindow.Selection.TypeText ActiveSheet.Range("F9")
wdoc.ActiveWindow.Selection.Goto What:=wdGoToBookmark, Name:="PA2"
wdoc.ActiveWindow.Selection.TypeText ActiveSheet.Range("G9")
wdoc.ActiveWindow.Selection.Goto What:=wdGoToBookmark, Name:="PA3"
wdoc.ActiveWindow.Selection.TypeText ActiveSheet.Range("H9")
wdoc.ActiveWindow.Selection.Goto What:=wdGoToBookmark, Name:="PA4"
wdoc.ActiveWindow.Selection.TypeText ActiveSheet.Range("I9")
wdoc.ActiveWindow.Selection.Goto What:=wdGoToBookmark, Name:="PA5"
wdoc.ActiveWindow.Selection.TypeText ActiveSheet.Range("J9")
wdoc.ActiveWindow.Selection.Goto What:=wdGoToBookmark, Name:="PA6"
wdoc.ActiveWindow.Selection.TypeText ActiveSheet.Range("G10")
wdoc.ActiveWindow.Selection.Goto What:=wdGoToBookmark, Name:="PA7"
wdoc.ActiveWindow.Selection.TypeText ActiveSheet.Range("H10")
wdoc.ActiveWindow.Selection.Goto What:=wdGoToBookmark, Name:="PA8"
wdoc.ActiveWindow.Selection.TypeText ActiveSheet.Range("I10")
wdoc.ActiveWindow.Selection.Goto What:=wdGoToBookmark, Name:="PA9"
wdoc.ActiveWindow.Selection.TypeText ActiveSheet.Range("J10")
wdoc.ActiveWindow.Selection.Goto What:=wdGoToBookmark, Name:="PA10"
wdoc.ActiveWindow.Selection.TypeText ActiveSheet.Range("K10")