title: VBA Excel formatting numbers to strings
body: <p>In sheet 1 the value is <code>45</code> so I want in sheet RESULTADO the format like this: <code>0045</code></p>
  
  <pre><code>Worksheets("RESULTADO").Range("B" &amp; row_counter) = Format(Worksheets(1).Range("B" &amp; row_counter).Value, "0000")
  </code></pre>
  
  <p>Why this doesn't work?</p>
  
  <p>I've tried also this, but neither it works: </p>
  
  <pre><code>Worksheets("RESULTADO").Range("B" &amp; row_counter) = CStr(Format(Worksheets(1).Range("B" &amp; row_counter).Value, "0000"))
  </code></pre>