title: VBA EXCEL - NUMBERFORMAT didn´t work but FORMAT FUNCTION did
body: <p>I have a range of cells named MyCells as string type. In which there are strings with 26 digits. </p>
  
  <p>Why the first statement (below), with NumberFormat didn´t work, but the second did?</p>
  
  <p>Trying cells look like this:</p>
  
  <p>38935094000163001000052234 --> 38.935.094/0001-63   001   000052234</p>
  
  <p>First attempt (didn´t work):</p>
  
  <pre><code>range(MyCells).Select
  
  Selection.NumberFormat = "00"".""000"".""000""/""0000""-""00""   ""000""   ""000000000"
  </code></pre>
  
  <p>Second (successful):</p>
  
  <pre><code>range(MyCells).Select
  
  For Each c In Selection
      c = Format(c, "00"".""000"".""000""/""0000""-""00""   ""000""   ""000000000")
  Next
  </code></pre>