title: Assigning values to a user defined data type
body: <p>I would like to assign a the values of a range to a user defined data type.</p>
  
  <p>I have a dataset of measurements taken at mutliple times over the course of a week stored in an excel sheet. I have created a variable for the range of the data set. Then I created a user defined data type with date and single types. Now I would like to assign the values of the range to the user defined data type. </p>
  
  <p>Data Set:</p>
  
  <pre><code>02/11/2011  3.8
  
  02/11/2011  2.4
  
  02/11/2011  8.9
  
  02/12/2011  5.7
  
  02/12/2011  4.6
  
  02/12/2011  2.6
  </code></pre>
  
  <p>I've made a user define data type:</p>
  
  <pre><code>Type phData
      Dy As Date
      ph As Single
  End Type
  </code></pre>
  
  <p>and created a variable of the phData type and matched the size to the range:</p>
  
  <pre><code>Dim dailyData() As tradeData
  Dim nrec as Integer
  nrec = dataRng.Rows.Count
  ReDim dailyData(nrec)
  </code></pre>
  
  <p>and defined the range of the dataset on the excel spreadsheet:</p>
  
  <pre><code>Dim dataRng As Range
  Set dataRng = Range("A2", Range("A2").End(xlDown).End(xlToRight))
  </code></pre>
  
  <p>and now I would like to assign the values in the range to the phData type. I can assign one value at a time using:</p>
  
  <pre><code> dailyData(1).Dy= dataRng(1).Value
  </code></pre>
  
  <p>but I am need something more efficient as I have about 4,000 records. </p>