title: Assigning and manipulating values in a Date array
body: <p>So I am trying to use a date array but have come across a lot of trouble with it. i've tried just about everything I can think of but can't get it to work. </p>
  
  <p>Essentially what the problem is, is that I can't get the date(the month in particular) that I insert into the array to be accepted. All of the information is stored in the appropriate variables but it isn't be assigned to the array index.</p>
  
  <pre><code>'grabs the date
  If k = 0 Then
      intDay = Cells(intRowNum + 2, 2).Value
      arrDateTime(intArrayIndex) = DateValue(strMonth &amp; " " &amp; intDay &amp; ", " &amp; intYear)
  ElseIf j = 0 Then
      arrDateTime(intArrayIndex) = DateAdd("d", 1, arrDateTime(intArrayIndex - 1))
  ElseIf j = 1 Then
      arrDateTime(intArrayIndex) = arrDateTime(intArrayIndex - 1)
  End If
  strTemp = "" 'resets temporary variable
  
  
  'grabs the time
  If j = 0 Then
      arrDateTime(intArrayIndex) = arrDateTime(intArrayIndex) + TimeValue(Cells(intRowNum + 3, 1).Value)
  Else
      arrDateTime(intArrayIndex) = arrDateTime(intArrayIndex) + TimeValue(Cells(intRowNum + intMaxRows + 3, 1).Value)
  End If
  </code></pre>
  
  <p>What am I doing wrong? What is the correct way to assign the date/time to a date array?</p>
  
  <h2>Update 1</h2>
  
  <p>Turns out the information was being retrieved incorrectly, had to use MonthName(Month(arrDateTime(intArrayIndex))) not just the MonthName. The other month information however was showing which was and still is a mystery. So the above issue for the most part is now solved , however the DateAdd() portion is not working properly.</p>
  
  <p>Also please note that I have simplified the elseif statements to just one else statement</p>
  
  <pre><code>arrDateTime(intArrayIndex) = DateAdd("d", j-1, arrDateTime(intArrayIndex - 1))
  </code></pre>
  
  <p>Neither codes worked properly though for the DateAdd portion. I've tested arrDateTime(2) = arrDateTime(1) and worked fine, so apparently there is something wrong with the array indexing as whenever I use it it returns a date that is way off.</p>