title: Date formatting with Excel VBA without Regex
body: <p>My goal is to include a specifically formatted date as a part of a long string.</p>
  
  <p>Basic format: yyyy.mm.dd.</p>
  
  <p>Goal format: yyyy/mm/dd</p>
  
  <p>So I searched via google, got to this site and have found this answer:</p>
  
  <pre><code>String = Format(Date, "yyyy/mm/dd")
  </code></pre>
  
  <p>However, it's not working. I still get the "yyyy.mm.dd." format.</p>
  
  <p>I have also found a solution that uses regular expressions to switch out characters (like how one does it with stream editor on a linux OS), but I would like to find a solution without using any extra functions.</p>
  
  <p>So far I have come up with a not quite elegant solution:</p>
  
  <pre><code>CurYear = Year(Date)
  CurMonth = Month(Date)
      If CurMonth &lt; 10 Then
          CurMonth = "0" &amp; CurMonth
      End If
  CurDay = Day(Date)
       If CurDay &lt; 10 Then
          CurDay = "0" &amp; CurDay
      End If
  
  Today = CurYear &amp; "/" &amp; CurMonth &amp; "/" &amp; CurDay
  </code></pre>