macfam929
New Member
- Joined
- Jul 28, 2010
- Messages
- 13
Hi. I am relatively new to the VB Macro's. I am trying to write a macro that creates a graph. I have everything working except i want to be able to format which data it graphs.
My data currently looks like this:
Column B Column C Column D .... Column M
0 0 20 40
0 0 21 45
5 0 22 50
10 5 23 80
20 7 24 100
50 9 25 105
My current code is:
Charts.Add
ActiveChart.ChartType = xlXYScatterSmoothNoMarkers
ActiveChart.SetSourceData Source:=dataRng, PlotBy:=xlColumns
ActiveChart.Location Where:=xlLocationAsNewSheet, Name:="Temp Graph"
What I want to do is instead of having the Source be dataRng and graph all columns all rows, to have it start graphing all columns (B-M) only after Column B is greater then 0. I can not delete the first few rows as they are used in other graphs.
Any help you could give on this would be greatly appreciated!! Thank you.
My data currently looks like this:
Column B Column C Column D .... Column M
0 0 20 40
0 0 21 45
5 0 22 50
10 5 23 80
20 7 24 100
50 9 25 105
My current code is:
Charts.Add
ActiveChart.ChartType = xlXYScatterSmoothNoMarkers
ActiveChart.SetSourceData Source:=dataRng, PlotBy:=xlColumns
ActiveChart.Location Where:=xlLocationAsNewSheet, Name:="Temp Graph"
What I want to do is instead of having the Source be dataRng and graph all columns all rows, to have it start graphing all columns (B-M) only after Column B is greater then 0. I can not delete the first few rows as they are used in other graphs.
Any help you could give on this would be greatly appreciated!! Thank you.