title: Using range from a column to sum corresponding values
body: <p>My data has two columns.<br />
  Column C (Alphabets - A, B, C ...)<br />
  Column D (Value - 1, 2, 3 ...).<br />
  Each alphabet has its corresponding value.</p>
  <p>I am trying to locate two cells (e.g. &quot;G&quot; to &quot;J&quot;) from column C to set the range, then use this range to sum the corresponding values in column D (i.e. 7 + 8  +9 + 10 = 34).</p>
  <p>I tried <code>VLOOKUP</code> and <code>MATCH</code>. The <code>MATCH</code> code returned Error 2015.</p>
  <pre class="lang-vb prettyprint-override"><code>Sub loop1()
      'Dynamic range for cells with data
      Dim LastRow As Long
      LastRow = Worksheets(&quot;HU&quot;).Cells(Rows.Count, 2).End(xlUp).Row '
      LastRow1 = LastRow - 1
      Rng = &quot;C1:D&quot; &amp; LastRow1
      matchrng = &quot;C1:C&quot; &amp; LastRow1
  
      'Locate start cell in data
      alphabet_start = &quot;G&quot;
      locate_start = Application.Match(alphabet_start, matchrng, 0)
  
      'Determine end cell
      alphabet_end = &quot;J&quot;
      'WIP_end = Application.VLookup(alphabet_end, myrange, 2, False)
  End Sub
  </code></pre>