title: Copying Cell with formatting from excel file to word document
body: <p>I am trying to write a <strong>Word macro</strong> which takes data from an <strong>Excel</strong> Cell and replaces a words in a <strong>Word</strong> file with this taken data.</p>
  
  <p>My first problem was to replace more than 250 chars, which I fixed.
  But this resulted in a new problem.
  The data in the Excel file is formatted and this formatting gets destroyed once I <strong>replace</strong> the word in the Word document.</p>
  
  <p>My replace function looks like this:</p>
  
  <pre><code>Sub ReplaceText(strSearch As String, strReplace As String)
      Dim sSplit As String: sSplit = "&lt;Å*Å&gt;"
      Dim sLeft As String
      Dim sLarge As Boolean: sLarge = True
  
      Do While sLarge = True
          If Len(strReplace) &gt; 251 Then
              sLeft = Left(strReplace, 250) &amp; sSplit
              strReplace = Right(strReplace, Len(strReplace) - 250)
              Call Split_Replace(strSearch, sLeft)
          ElseIf Len(strReplace) &lt;= 251 Then
              Call Split_Replace(strSearch, strReplace)
          sLarge = False
          End If
          strSearch = sSplit
      Loop
  End Sub
  
  Sub Split_Replace(strSearch As String, strReplace As String)
      With Selection.Find
          .Text = strSearch
          .Replacement.Text = strReplace
          .Forward = True
          .MatchCase = False
          .MatchWholeWord = False
          .MatchWildcards = False
          .MatchSoundsLike = False
          .Wrap = wdFindContinue
          .Execute Replace:=wdReplaceAll
      End With
  End Sub
  </code></pre>
  
  <p>And I call it this way: </p>
  
  <pre><code>Call ReplaceText("intro", MyWB.Sheets(Geschlecht).Cells(7, 4)
  </code></pre>
  
  <p>But everything like (bold, italic, underline, numbering, etc.) gets removed.
  If I use a MsgBox to show me the data he got from the excel cell, it is formated in the right was:
  for example in the Replace Function </p>
  
  <pre><code>MsgBox strReplace 
  </code></pre>
  
  <p>Shows the right formatting.</p>
  
  <p>I hope one of you guys know how to fix this or could give me a tip in the right direction.</p>
  
  <p>Greetings Lars</p>