title: VBA Update source data for chart
body: <p>I am using VBA to generate a chart.</p>
  
  <p>With the following code I can select the data from column number <code>11</code> to the last column, which I have stored in <code>LastColumnNumber</code> variable:</p>
  
  <p><code>ActiveChart.SetSourceData Source:=Union(Sheets(SheetName).Range(Cells(1, 11), Cells(1, LastColumnNumber)), Sheets(SheetName).Range(Cells(4, 11), Cells(4, LastColumnNumber)))</code></p>
  
  <p>Because I have a lot of zero values before and after the data that I actually need displayed in the chart I am using the following methods to find out the addresses for the first and the last non-zero cells:
  <a href="https://stackoverflow.com/a/42413582/2012740">https://stackoverflow.com/a/42413582/2012740</a></p>
  
  <p>How can I update the fist piece of code to implement the solutions from the linked answer, and narrow the range for the chart accordingly?</p>