#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 64
Default Plot Ranges

I can write

With ActiveChart
.ChartType = xlXYScatterLinesNoMarkers
.SetSourceData Source:=Sheets(1).Range(Cells(1, 1), Cells(15, 2))
End With

but this doesn't work

setrA = Sheets(1).Range(Cells(1, 1), Cells(15, 2))
With ActiveChart
.ChartType = xlXYScatterLinesNoMarkers
.SetSourceData Source:=rA
End With

Can someone explain why? [I don't want just a fix, but an understanding of
plotting procedures.

TIA,
Mike
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default Plot Ranges

When you use the With ActiveChart and then tell it the source is in in
Range(Cells.... it does not find Cells with ActiveChart. Although you
thought you qualified the Cells with Worksheets(1), VBA don't acknowledge it.
So in the second case where you first qualified the range by setting it to
Worksheets(1) in a variable before trying to apply it, it does acknowledge
it. I do the same thing repetitively and I should know better.

"MikeM" wrote:

I can write

With ActiveChart
.ChartType = xlXYScatterLinesNoMarkers
.SetSourceData Source:=Sheets(1).Range(Cells(1, 1), Cells(15, 2))
End With

but this doesn't work

setrA = Sheets(1).Range(Cells(1, 1), Cells(15, 2))
With ActiveChart
.ChartType = xlXYScatterLinesNoMarkers
.SetSourceData Source:=rA
End With

Can someone explain why? [I don't want just a fix, but an understanding of
plotting procedures.

TIA,
Mike

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 64
Default Plot Ranges

Actually, the opposite is true. The first version worked but the second didn't.

"JLGWhiz" wrote:

When you use the With ActiveChart and then tell it the source is in in
Range(Cells.... it does not find Cells with ActiveChart. Although you
thought you qualified the Cells with Worksheets(1), VBA don't acknowledge it.
So in the second case where you first qualified the range by setting it to
Worksheets(1) in a variable before trying to apply it, it does acknowledge
it. I do the same thing repetitively and I should know better.

"MikeM" wrote:

I can write

With ActiveChart
.ChartType = xlXYScatterLinesNoMarkers
.SetSourceData Source:=Sheets(1).Range(Cells(1, 1), Cells(15, 2))
End With

but this doesn't work

setrA = Sheets(1).Range(Cells(1, 1), Cells(15, 2))
With ActiveChart
.ChartType = xlXYScatterLinesNoMarkers
.SetSourceData Source:=rA
End With

Can someone explain why? [I don't want just a fix, but an understanding of
plotting procedures.

TIA,
Mike

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
Removing Plot lines between plot points on a line chart JDKapono24 Charts and Charting in Excel 2 April 2nd 23 07:07 PM
How to plot Date Ranges on Same Graph JJ Charts and Charting in Excel 2 April 7th 09 11:03 PM
How to change empty ranges from a plot series without generating e luizavala Excel Worksheet Functions 0 August 8th 06 11:26 PM
can i change plot area colors for different date ranges steve Charts and Charting in Excel 1 June 27th 06 08:47 PM
How do I automatically plot different ranges of data in different. 3D-charting Charts and Charting in Excel 1 February 2nd 05 02:40 PM


All times are GMT +1. The time now is 04:25 PM.

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

About Us

"It's about Microsoft Excel"