Using VBA, I would like to create a macro that will plot a selected region prior to running the macro. I have a macro that can plot the same data selection each time, but I would like it to plot a selection. My current code is included below. Thanks.
Sub AddChart()
'
' AddChart Macro
'
' Keyboard Shortcut: Ctrl+Shift+D
'
With ActiveSheet.ChartObjects.Add _
(Left:=100, Width:=375, Top:=75, Height:=225)
.Chart.SetSourceData Source:=Sheets("Sheet1").Range("A1:B9")
.Chart.ChartType = xlXYScatter
End With
End Sub