VisualBasic

xgary.wilsonx

New Member
Joined
Dec 17, 2009
Messages
40
Hi

I am trying to create a macro that will change the scource data of my chart to resize the data range, however i want it to automatically resize according to either howmany columns of data there are present or have a popup that will request the number of columns to include as series.

any help greatly received

the code i have so far is:


Sub sourcetest()
'
' sourcetest Macro
' Macro recorded 18/12/2009 by WGS
'
'
ActiveSheet.ChartObjects("Chart 2").Activate
ActiveChart.ChartArea.Select
ActiveChart.SetSourceData Source:=Sheets("Auto").Range("A40:D69"), PlotBy:= _
xlColumns
ActiveWindow.Visible = False
Windows("graphs GW.xls").Activate
Range("B37").Select
End Sub

Many thanks
 

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.

Forum statistics

Threads
1,213,536
Messages
6,114,208
Members
448,554
Latest member
Gleisner2

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top