Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
SPV SPV is offline
external usenet poster
 
Posts: 8
Default 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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,124
Default Multiple range selection issue

PLEASE quit multi posting. Not a good way to make friends

--
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


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Multiple range selection issue

if you did
set Range1 = Range("A2:A14")

then it would be

Union(Range1,Range2,Range3).Select

--
Regards,
Tom Ogilvy


"SPV" wrote:

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


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Multiple range selection issue

if you did

Range1="A2:A14"

then it would be

Sub AB()
Range1 = "A2:A14"
Range2 = "E2:E14"
Range3 = "H2:H14"
Range(Range1 & "," & Range2 & "," & Range3).Select
End Sub

--
Regards,
Tom Ogilvy


"SPV" wrote:

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


  #5   Report Post  
Posted to microsoft.public.excel.programming
SPV SPV is offline
external usenet poster
 
Posts: 8
Default Multiple range selection issue

On Jun 27, 8:16 pm, "Don Guillett" wrote:
PLEASE quit multi posting. Not a good way to make friends

--
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- Hide quoted text -


- Show quoted text -


I have joined the group two days before and was not aware much of it's
working...
Do you mean I should not ask the same question in different Excel
groups?
I wanted some quick tips on my problem that is why posted in multiple
group...
If all the "friends" are there in multiple groups yes I should only be
doing one posting...
Please clarify...
SPV



  #6   Report Post  
Posted to microsoft.public.excel.programming
SPV SPV is offline
external usenet poster
 
Posts: 8
Default Multiple range selection issue

On Jun 27, 8:22 pm, Tom Ogilvy
wrote:
if you did

Range1="A2:A14"

then it would be

Sub AB()
Range1 = "A2:A14"
Range2 = "E2:E14"
Range3 = "H2:H14"
Range(Range1 & "," & Range2 & "," & Range3).Select
End Sub

--
Regards,
Tom Ogilvy



"SPV" wrote:
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- Hide quoted text -


- Show quoted text -


Hi Tom Ogilvy,
The range is calculated besed on some logic and I set the range like
following...

Set X_axis = ActiveSheet.Range(Cells(Row_start, 1), Cells(Row_end, 1))
Set NULL_Thread_activity = ActiveSheet.Range(Cells(Row_start,
NULL_Col), Cells(Row_end, NULL_Col))
Set Thread_activity = graph_range (graph_range was precalculated the
same way)

When I use MsgBox to display the address range it is coming correctly
if I do like this
MsgBox X_axis.Address

Hope I am clear...
Now I have two issues...
1. For plotting the graph I should first select the range ...
2.Then
ActiveChart.SetSourceData Source:=ActiveSheet.Range("X_axis,
Thread_activity, NULL_Thread_activity")

Please advice me...


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Multiple range selection issue SPV Excel Discussion (Misc queries) 1 June 27th 07 04:15 PM
Multiple range selection I. N. Manoussopoulos Excel Programming 2 August 9th 06 06:58 PM
Weird range selection issue XL2003- help please! KR Excel Programming 3 April 28th 06 08:27 PM
Multiple Range Selection mcgj Excel Programming 1 January 4th 06 02:49 AM
Excel VBA - Range(Selection, Selection.End(xlDown)).Name issue. jonH Excel Programming 3 June 7th 04 09:13 PM


All times are GMT +1. The time now is 07:23 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"