Sub test()
Dim xR As Range
If ActiveChart Is Nothing Then MsgBox "選圖表": Exit Sub
Set xR = Application.InputBox(prompt:="選資料範圍", Type:=8)
ActiveChart.SetSourceData Source:=xR
End Sub
Sub test()
Dim xR As Range
If ActiveChart Is Nothing Then MsgBox "選圖表": Exit Sub
Set xR = Application.InputBox(prompt:="選資料範圍", Type:=8)
ActiveChart.SetSourceData Source:=xR
End Sub