title: Create chart with values from specific columns
body: <p>I have a macro that create a chart with values from column "Activation" and column "Value" (without header).<br>
  Right now, "Activation" column is A and "value" column is on E, but sometimes this positions can be different.<br>
  How can i change this macro to work from any position of "activation" and "value"? </p>
  
  <pre><code>    Sub CreateChart()
  
      Dim rng As Range
      Dim cht As Object
  
      Set find1 = Sheet1.Cells(1, 1).EntireRow.Find(What:="Activation", LookIn:=xlValues, LookAt:=xlPart, SearchOrder:=xlByColumns, SearchDirection:=xlPrevious, MatchCase:=False)
      CA = find1.Column 'column number for Activation
      Set find2 = Sheet1.Cells(1, 1).EntireRow.Find(What:="Value", LookIn:=xlValues, LookAt:=xlPart, SearchOrder:=xlByColumns, SearchDirection:=xlPrevious, MatchCase:=False)
      CV = find2.Column 'column number for Value
      Dim lastRow As Long   
      lastRow = ActiveSheet.Cells(Rows.Count, CA).End(xlUp).Row
  
      'I want to change the A column with CA and the E column with CV
      Set rng = Range("A2:A" &amp; lastRow &amp; ",E2:E" &amp; lastRow)
  
      Set cht = ActiveSheet.Shapes.AddChart2  
      cht.Chart.SetSourceData Source:=rng
      cht.Chart.HasTitle = False          
      cht.Chart.ChartType = xlLine
          With ActiveSheet
      .ChartObjects(1).Top = .Range("I2").Top
      .ChartObjects(1).Left = .Range("I2").Left
      .ChartObjects(1).Width = 500
      End With
  
      End Sub
  </code></pre>