title: VBA, Excel: how to add a chart into a selected range
body: <p>I am trying to add a chart into a range I have selected. Im running into some issues finding the proper way to do so. I there a way to do something along the lines of</p>
  <pre><code>Dim cht as ChartObject
  Dim UserSelection as Range
  
  Set UserSelection = ActiveSheet.Selection
  Set cht = ActiveSheet.ChartObjectsy.Add(UserSelection)
  </code></pre>
  <p>trying to set the cht variable is throwing an error. I really looking for how to .Add into my selected range.
  thanks in advance</p>