title: Import data from Excel to Word - format number with comma
body: <p>I created a macro in VBA that allows me to choose a cell populated with a number and pull the number in that cell into a specific location in a word document.</p>
  
  <p>However, when I run the macro, the number that is populated into Word is not formatted with commas to separate thousands (e.g. looks like "10000" but need to look like "10,000"). The number is already formatted with the commas in Excel but the format does not carry over into Word.</p>
  
  <p>How can I format the number with commas when pulling data from Excel to Word?</p>
  
  <p>Here is what I have so far:</p>
  
  <pre><code>Sub Excel to Word()
      Dim wrdApp As Word.Application
      Dim wrdDoc As Word.Document
      Dim i As Integer
      Set wrdApp = CreateObject("Word.Application")
      wrdApp.Visible = True
      Set wrdDoc = wrdApp.Documents.Open("C:\Folder\qsn.docm")
      With wrdDoc
  
          'find text on word document
          .Application.Selection.Find.Text = "AL1"
          .Application.Selection.Find.Execute
  
          'now found, type text from designated cell
          .Application.Selection.TypeText ActiveSheet.Range("C2")
  
          'find text on word document
          .Application.Selection.Find.Text = "AL2"
          .Application.Selection.Find.Execute
  
          'now found, type text from designated cell
          .Application.Selection.TypeText ActiveSheet.Range("D2")
  
          If Dir("C:\Folder\QSN.doc") &lt;&gt; "" Then
              Kill "C:\Folder\QSN.doc"
          End If
          .SaveAs ("C:\Folder\QSN.doc")
          .Close ' close the document
      End With
      wrdApp.Quit ' close the Word application
      Set wrdDoc = Nothing
      Set wrdApp = Nothing
  End Sub
  </code></pre>