title: Replacing forward slash with hyphen in date VBA
body: <p>I have searched all over and normally find my answer, however this one is peculiar. I have to format a date for a program such that it doesn't have forward slashes in the date to write to a file path. I am able to get the <strong>look</strong> in the cell to appear as if it's using hyphens, but the <strong>value</strong> in the formula bar still shows it with backslashes. </p>
  
  <p>For instance, today's date could be typed into cell A1 as <em>"10/18/2017"</em> and it would appear in the cell it's typed as <em>"10-18-2017"</em>, but in the formula bar and when I get the value of the that cell it's still <em>10/18/2017</em>.
  I'm extracting the value like: <code>Range("A1").value</code></p>
  
  <p>Below is the code that I'm using to try to change the actual value of the cell.</p>
  
  <pre><code>Range("A1").NumberFormat = "mm-dd-yyyy"
  </code></pre>
  
  <p>This did exactly what I mention above. Tricks the user into thinking they solved the problem, but not really. Then I thought well let's just replace the <code>/</code> character...</p>
  
  <pre><code>Range("A1").value = Replace(Range("A1").value, "/", "-")
  </code></pre>
  
  <p>Still no dice and not anything I can find on the interwebs. Sorry if this has been answered, I searched and searched, even within stack</p>