ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Multiple range selection issue (https://www.excelbanter.com/excel-discussion-misc-queries/148157-multiple-range-selection-issue.html)

SPV

Multiple range selection issue
 
I was trying to plot the Scatter graph for a specified range in
different columns. I have 3 columns with specified ranges Col 1 X axis
and the col2 and 3 plotted on Y axis . I have generated a record macro
for the same and it look like the same below.

Range("A2:A14,E2:E14,H2:H14").Select
Range("H2").Activate
Charts.Add
ActiveChart.ChartType = xlXYScatterSmooth
ActiveChart.SetSourceData Source:=Sheets("Sheet1").Range( _
"A2:A14,E2:E14,H2:H14"), PlotBy:=xlColumns
ActiveChart.Location Whe=xlLocationAsObject, Name:="Sheet1"
With ActiveChart
.HasTitle = True
.ChartTitle.Characters.Text = "ARM Load"
.Axes(xlCategory, xlPrimary).HasTitle = True
.Axes(xlCategory, xlPrimary).AxisTitle.Characters.Text = "Time
in Sec"
.Axes(xlValue, xlPrimary).HasTitle = True
.Axes(xlValue, xlPrimary).AxisTitle.Characters.Text = "Load in
%"
End With
End Sub

I have already defined ranges for
A2:A14 = Range 1
E2:E14 = Range 2
H2:H14 = Range 3 by declaring them as range...

Now when I gave Range("Range1,Range2,Range3").Select = didn't work
for me...
I tried Range("Range1","Range2","Range3).Select also.. didn't give me
result...

Now I tried Union(Range(X_axis), Range(NULL_Thread_activity),
Range(NULL_Thread_activity)).Select

Please throw some light on how to program the same in VBA with
specified ranges and not taking explicit cell references...

Thanks in advance for helping me....


Regards,
SPV


Don Guillett

Multiple range selection issue
 
In which group would you like an answer?
--
Don Guillett
SalesAid Software

"SPV" wrote in message
oups.com...
I was trying to plot the Scatter graph for a specified range in
different columns. I have 3 columns with specified ranges Col 1 X axis
and the col2 and 3 plotted on Y axis . I have generated a record macro
for the same and it look like the same below.

Range("A2:A14,E2:E14,H2:H14").Select
Range("H2").Activate
Charts.Add
ActiveChart.ChartType = xlXYScatterSmooth
ActiveChart.SetSourceData Source:=Sheets("Sheet1").Range( _
"A2:A14,E2:E14,H2:H14"), PlotBy:=xlColumns
ActiveChart.Location Whe=xlLocationAsObject, Name:="Sheet1"
With ActiveChart
.HasTitle = True
.ChartTitle.Characters.Text = "ARM Load"
.Axes(xlCategory, xlPrimary).HasTitle = True
.Axes(xlCategory, xlPrimary).AxisTitle.Characters.Text = "Time
in Sec"
.Axes(xlValue, xlPrimary).HasTitle = True
.Axes(xlValue, xlPrimary).AxisTitle.Characters.Text = "Load in
%"
End With
End Sub

I have already defined ranges for
A2:A14 = Range 1
E2:E14 = Range 2
H2:H14 = Range 3 by declaring them as range...

Now when I gave Range("Range1,Range2,Range3").Select = didn't work
for me...
I tried Range("Range1","Range2","Range3).Select also.. didn't give me
result...

Now I tried Union(Range(X_axis), Range(NULL_Thread_activity),
Range(NULL_Thread_activity)).Select

Please throw some light on how to program the same in VBA with
specified ranges and not taking explicit cell references...

Thanks in advance for helping me....


Regards,
SPV




All times are GMT +1. The time now is 11:59 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com