title: how to use variable in range using vba
body: <p>Hello I have written code for generating graph using vba. everything working correctly ,but problem is i want to use variable for selecting particular column 
  the code is :</p>
  
  <pre><code>Set x = Range("$CF$2", Range("$CF$2").End(xlDown))
  Set y = Range("$CG$2", Range("$CG$2").End(xlDown))
  Dim c As Chart
  Set c = ActiveWorkbook.Charts.Add
  Set c = c.Location(Where:=xlLocationAsObject, Name:=assume)
  With c
  .ChartType = xlXYScatterLines
  
  ' set other chart properties
  
  With .Parent
  .Top = Range("cl1").Top
  .Left = Range("cl12").Left
  .Name = "c"
  End With
  End With
  
  Dim s As Series
  Set s = c.SeriesCollection(1)
  With s
  .Values = y
   .XValues = x
  ' set other series properties
  
  End With
  </code></pre>
  
  <p>I want to use variable <code>COLs</code> in first to line they are</p>
  
  <pre><code>Set x = Range("$CF$2", Range("$CF$2").End(xlDown))
  Set y = Range("$CG$2", Range("$CG$2").End(xlDown))
  </code></pre>
  
  <p><code>COLs</code> is variable of string</p>