title: Update Chart range to end Row
body: <p>I have created the below macro its working fine .. I wants to pick value to end Row dynamically instead $A$3:$A$328  .. something like Range("A3" &amp; Rows.Count).End(xlUp).Row</p>
  
  <p>Can anyone help me please </p>
  
  <pre><code>  Private Sub CommandButton1_Click()
  
      Dim arrCharts, cht
      Dim wb As Worksheet
      Dim wbTarget As Workbook
      Dim sh As Worksheet
  
  
      Set wbTarget = Workbooks.Open(Filename:="C:\Users\mahather\Desktop\Report\Summary Report.xlsx")
      Set wb = wbTarget.Worksheets("Graph")
      Set sh = wbTarget.Worksheets("Summary")
  
  
      arrCharts = Array("Chart 2", "Chart 5")
  
      For Each cht In arrCharts
          With wb.ChartObjects(cht).Chart
              .SeriesCollection(1).XValues = "='Summary'!$A$3:$A$328"
          End With
      Next cht
  
  
      End Sub
  </code></pre>