title: How to populate a table in excel using variables for cell (x,y) values
body: <p>I've been searching stack over flow constantly for the past few weeks as i learn excel vb but finally I'm stumped.  </p>
  
  <p>I need to activate a cell using a variable for the x location and a variable for the y location.  </p>
  
  <p>The xval is an integer 
  yval is a string  </p>
  
  <p>I'm trying to use the match function to do this with no luck.  </p>
  
  <p>Here's what I've tried. </p>
  
  <pre><code>Sheets("Attributes").Select      'this is the sheet with the raw data
  Range("C2").Activate
  Dim xval As String                'this is the row I'm looking for
  Dim yval As Integer               'this is the colum I'm looking for
  Dim value As String               'when I find the exact right cell on the next sheet this is the value that needs to go in it.
  
  ' start loop here
  
  xval = ActiveCell.Offset(0, -2)   'populate variables
  yval = ActiveCell
  value = ActiveCell.Offset(0, 2)
  Sheets("output").Select              'switch to output sheet
  Range("A1").Activate
  
  Cells(WorksheetFunction.Match(xval, "A:A", 0), WorksheetFunction.Match(yval, "A1:A500", 0)).Activate    'this line doesn't work
  
  
  ActiveCell = value
  
  'end loop when data runs out using is empty function
  </code></pre>