title: "Unable to set the NumberFormat property of the Range class"
body: <p>This code has been working for ages. I thought maybe I accidently pressed a key but I cannot seem to see it. I suddenly get the error:</p>
  
  <p><strong>Unable to set the NumberFormat property of the Range class</strong></p>
  
  <p>in the below code:</p>
  
  <pre><code>Worksheets("Sheet1").Cells(y + k, x + j).Select
  TempValue = Worksheets("Sheet1").Cells(y + k, x + j).Value
  Worksheets("Sheet1").Cells(y + k, x + j).NumberFormat = "#,##0" //ERROR HERE
  Worksheets("Sheet1").Cells(y + k, x + j).Value = TempValue
  </code></pre>