title: Excel VBA Won't Keep Leading Zeroes
body: <p>I can't seem to find a way to save leading zeros in my VBA code. The zeros are necessary since they correspond to unique IDs. </p>
  
  <p>I've tried changing the number format to text and 0000.... in excel and the same approach in my actual code: 
      ActiveSheet.Cells(i, j).NumberFormat = "00000"</p>
  
  <p>Any other suggestions? (If I manually type these numbers into VBE it strips the leading zeros too).
  EDIT:</p>
  
  <pre><code>Sheets.Add.Name = "Temp"
  Sheets("Sheet1").Select
  ActiveSheet.Cells(2, 2).NumberFormat = "000"
  cid = Cells(2, 2)
  MsgBox cid
  Sheets("Sheet2").Select
  ActiveSheet.Cells(6, 1).NumberFormat = "00000"
  sid = Cells(6, 1)
  Sheets("Temp").Select
  Url = _
  "URL;" &amp; _
  "http......asp?" &amp; _
  "X1=" &amp; cid &amp; "&amp;" &amp; _
  "X2=" &amp; sid &amp; "&amp;"
  </code></pre>
  
  <p>This is inside a loop ultimately but I'm debugging as individual iterations.</p>