Scatter plot - macro OK - VB 6 not OK

If I have 2 rows of data, say,  A1 to C1 and A2 to C2 and record a macro :-

Charts Add
ActiveChart.ChartType =  xlXYScatter
ActiveChart.SetSourceData Source := Sheets ( " Sheet1 " ).Range ( " A1 : C2 
" ),  plotby := xlrows

This works - I get 3 pairs of co-ordinates in a graph.

When I use the equivalent code in a VB6 program :-

Set ch = wbook1.Charts.Add

With ch

..ChartType =  xlXYScatter

..ChartWizard  Source :=  wsheet1.Range ( " A1 : C2 "  ) , plotby :=  xlRows

End With

I get SIX separate points , 2 at x axis co-ordinate 1 , 2 more at  x=2  etc.

I have tried xlColumns, leaving the plotby out etc. but I am missing 
something very obvious I think.

Any suggestions please.


0
bre2 (1)
4/20/2005 10:18:56 AM
excel.charting 18370 articles. 0 followers. Follow

1 Replies
527 Views

Similar Articles

[PageSpeed] 37

Brian -

I take it you have X values or category labels in A1:C1 and Y values in A2:C2. You 
should insert a column, so A1:C2 is shifted to B1:D2, then leave cell A1 blank and 
put a label (series name) into A2. Then use the range A1:D2 as the source data range.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services
Tutorials and Custom Solutions
http://PeltierTech.com/
_______

Brian Elliott wrote:

> If I have 2 rows of data, say,  A1 to C1 and A2 to C2 and record a macro :-
> 
> Charts Add
> ActiveChart.ChartType =  xlXYScatter
> ActiveChart.SetSourceData Source := Sheets ( " Sheet1 " ).Range ( " A1 : C2 
> " ),  plotby := xlrows
> 
> This works - I get 3 pairs of co-ordinates in a graph.
> 
> When I use the equivalent code in a VB6 program :-
> 
> Set ch = wbook1.Charts.Add
> 
> With ch
> 
> ..ChartType =  xlXYScatter
> 
> ..ChartWizard  Source :=  wsheet1.Range ( " A1 : C2 "  ) , plotby :=  xlRows
> 
> End With
> 
> I get SIX separate points , 2 at x axis co-ordinate 1 , 2 more at  x=2  etc.
> 
> I have tried xlColumns, leaving the plotby out etc. but I am missing 
> something very obvious I think.
> 
> Any suggestions please.
> 
> 

0
4/24/2005 3:00:02 AM
Reply:

Similar Artilces:

scatter
Assume 1000 pairs in 2 columns with values similiar to (12.2,17233). x is in the range of 8.4-19.2 and y is 0-20000. The x axis is on the bottom and the y is on the left with x crossing y @ maximum y How does one plot this? Have you tried this? What happened? Where did you get stuck? -- Regards, Tushar Mehta, MS MVP -- Excel www.tushar-mehta.com Excel, PowerPoint, and VBA add-ins, tutorials Custom MS Office productivity solutions In article <98E0E92C-1444-4327-B272-BCAA25A62259@microsoft.com>, shennigan@peiinc.com says... > Assume 1000 pairs in 2 columns with values similia...

Mailbox Restore #6
Hi! Im about to restore a SBS 2003 server with exchange (2003) after a system crash. I don't want to restore over my new installed machine, so what's the easiest way? Im only interested in the mailboxes and public folders content. Software for extracting directly fom edb files are to expensive, or is there any cheap one? :-) /Jonas On Sun, 5 Mar 2006 18:36:24 +0100, "Jonas Nilsson" <jonas_nilsson@hotmail.com> wrote: >Hi! > >Im about to restore a SBS 2003 server with exchange (2003) after a system >crash. > >I don't want to restore over my ...

Simple Exchange 6.5 move to Exchange 2007 ?
Is there a simple way to move Exchange 6.5 from a Windows 2003 SBS server to Exchange 2007 on an SBS 2008 server with the same domain and computer name as the SBS 2003 server? We are currently planning to: Create the users on the SBS 2008 server from scratch, not migrate them. Use Outlook on each client to import their e-mail into the Exchange 2007 server from PST files exported from the 6.5 server to PST using Outlook. That seems cumbersome and time consuming. Is there a way to backup the store on Exchange 2003 on the old server and restore it to Exchange 2007 on the new server...

XY Scatter chart
I have a scatter chart with one PAIR of data for each of 31 business activities. For example, two data points for "Delivery," one showing the ranked importance of this activity and the the second point showing the organization's performance in this category. Unfortunately, the descriptions of these business activities are a lot longer than the above example and R. Bovey's XY Labeler results in a crowded, unreadable chart. Is there any way to name these business activities on the X Axis, at a 45 or 90 degree angle? Put the description in one column. In 2 adjacent...

Newsgroup Retention and Outlook Express 6
I'm currently using Outlook Express 6 as my newsreader and was unaware that OE would delete messages/posts as soon as they are removed from the microsft.public.pos server/group, which is currently 60 days (regardless what you have set in OE). Is there anybody that can provide me with all the microsoft.public.pos posts preferable in a OE database/format ? ( I can sign up to some newsgroup servers but their retention is usually less than a month or so. Google has them available without attachments but you can only access them thru a web interface) Any help? I believe Google cache...

Scatter and bar
Hi I have posted a screen shot of my chart here - http://xs.to/xs.php?h=xs35&d=05260&f=chart.jpg I would like to know if it is possible with the chart to change the turquoise line named Digester feed mean % DS to work with the scatter chart using the secondary axis already in place as a bar mixed scatter chart? I really appreciate your comments i think the chart would look great like this. Many Thanks Rob - p.s if the image doesnt load right click and choose show picture then it should load. Select the series that you want to change to a bar chart. Right click and choos...

xy scatter plot and split function clarification
I have data like this in a file. i need to draw a simple XY scatter plot, 221 -255 196 -255 191 -255 181 -255 168 -255 159 -255 151 -255 150 -255 105 -255 I opening this file and try to use split function Do Until EOF(TestFileNumber) Line Input #TestFileNumber, TempStr If TempStr = "" Then 'Do nothing Else ReDim Preserve Str2(Count) Str2 = Split((TempStr), " ") Count = Count + 1 End If but Str2 array indexes are always 0 and 1 though count increments and how do i draw the xyscatter chart whi...

Latest Security Patch Iced my Outlook and Explorer V 6.0
I downloaded the latest security update. When I restarted my PC, I found I could not access the internet using Explorer from the PC, and my Outlook would not connect to the internet either - I am guessing it uses Explorer as its means to access the net. Outlook error is 0x00CCC0D server cannot be found. I can get into the server from the net and other PCs. Also, there are 2 servers giving the same result. To add to the mystery - I have other applications that are still able to access the internet and download data OK. The PC is still working OK to the rest of the workgroup, and I ca...

OE 6 Hangs when you click on a hot link in a message
Hi, I have a small home network with XP Pro and Office 2000. I use OE v6.00.2800.1123. I tried downloading patches but it said I was on a network and I would have to see the administrator. That was me, but when I tried to download the network patches it said i was missing a bunch of files. The othe day I downloaded and installed my employer's software to access my workplace VPN. All went well and I have that installed and can readily access it. But now when I use email and somebody sends me a hotlink, when I click on it OE hangs hard. The three fingered boot will bring up the ...

XY Scatter Chart
I need some help with an XY Scatter chart. I need to add a data table to the chart. Is there a way to do this? I routinely add the data table to line and bar charts. In this case the data needs to be in the xy scatter format. Thanks Here is a works around, I will assume the data is in columns Select the data and copy Move to an unused part of the worksheet; used Edit | Paste Special, specify Transpose Put borders on the new 'table' and adjust the column width Select the new table; with SHIFT help down use Edit; use the Copy as Picture item Move to your chart and copy the picture o...

New Exchange Server #6
I want to build a new exchange server 2003 to replace the one we currently have. I want to be able to: Decomission the old server once the new one is in place. Keep the same IP and the same name so I won't have to make any DNS changes. There are about 200 mailboxes and about 50 public folders. The servers are near identical, exept that the new one is RAID5 and the old one is RAID0. What are the correct steps to get this accomplished? Thank you before hand for your help. Fabio Hi, Basically: 1. Build the new server to the point it's ready to join the domain and is Windows S...

Acrobat 6.0 "attach as PDF" toolbar
I cannot get rid of this "toolbar" - it's actually just a button. I turn it off under "customize>toolbars" and it comes back. I altered the registry key at HKEY_CURRENT_USER\Software\ADOBE\Acrobat\PDFMaker \6.0\Outlook\OutlVisible to "0x000000". The key even stays at that value (for a while) but the acrobat button comes back. What can I do. I am willing to delete it forever - is there a .dll I can scrap to make sure this goes away? A setting under options? Anyone have any advice? Thanks. On Jun 4, 8:17 pm, dewey <dewe...@gmail.com> wrote: > I ca...

Circular Logging OK for SMTP Connector
Is it a good idea if I enable Circular Logging for my Exch2003 SMTP connector server ? I notice log files are being left out and consuming disk space there. Hi Marlon, If there is no mailboxes on that server you can safely enable circular logging... -- Regards, Sasa Milovanovic MCSE:Messaging sasa.milovanovic(at)exchangemaster.net "Marlon Brown" <nomail@brown.com> wrote in message news:uGi%23WLRxFHA.1168@TK2MSFTNGP10.phx.gbl... > Is it a good idea if I enable Circular Logging for my Exch2003 SMTP > connector server ? I notice log files are being left out and ...

Scatter Plot
Hello, Is there a way of adding labels to points (besides series name, x and y) besides writing VBA code? Thanks. Bill Check out Rob Bovey's "XY Chart Labeler" add-in: http://www.appspro.com/utilities/Labeler.asp In article <egLFGKS3DHA.3936@TK2MSFTNGP11.phx.gbl>, "Bill" <whmc2@ix.netcom.com> wrote: > Hello, > Is there a way of adding labels to points (besides series name, x and y) > besides writing VBA code? > > Thanks. > > Bill > > ...

Nameing scattered data in chart (dot's)
I consider myself as a fairly competent excel user, but I seriuosly got stucked on this on!! Im duing a simple scattered chart with prices up along Y-axis and miles along the X-axis ... But I would like each scattered dot to be named after "my coloum N" which is car1, car2, car3 ...etc (Meaning .. If I have 30 Cars...where is car no. 1 in the chart and where is car no. 30) ?? The only luck I had so fare was either to show the X, Y- value or chart name!!! Hope someone can assist me if it is possible.. Thanks in advance NielsChr Hi, Simplest way is to use ...

Vista, MS Access 2003 and MS ADO Ext 6.0 vs 2.x
I am running into an issue with MS Access 2003 installed on Vista. Apparantly in the MS ADO Ext 6.0 version either (format, round, or sum) is not in that DLL. However, when I link to v2.8 of the DLL, I don't have an issue. I am getting the following error message when running my query. "Function is not available in expressions in query expressions." Does anyone have other workarounds? I am distributing this application in an MDE format, so I was wondering if the end users may experience issues, if I link to my version of msadox.dll instead of the installed version. I tried s...

Scatter Charts
I am using Excell 2000 I feel like a dummy. While I use Excell on a regular basis, about 1 a month, I have not created a chart (graph) in Excell in years. Now I am trying to create a scatter graph of which I have never done. This is for our salary budget. I have been asked to show how many people are in each salary range percentile by wages. Example Emp #1, making $25000 may be in the 70% range for a specific classification, while emp #2, making $25000 is in the 80% range for his classification. I began by making a chart with the salary range percentiles in each column Ex: 70...

Scatter chart
I would like to make a scatter chart on basis of percentages that I have in 1 column. This is possible with the regular scatter chart. However, now I would like to have style/color of the marker of each observation to vary depending on their value in another column. So the chart should consist of all observations with the style of the marker defined by the value in another column. Is this possible? Burger - An Excel XY (Scatter) chart type is usually used to show the relationship between two variables. The data are pairs of values for each observation, usually an "independent"...

Scatter Graph Help
Dear All, I believe I have a simple problem however am puzzled as to how to achieve my end result. I have three sets of data. Delegate Name John Steve Brian Stacy Potential 6 7 8 9 Value 7 8 9 7 I need to produce a scatter graph that plots the 'Potential Heading' values against the x axis and the 'Value Headings' against the y axis. Each time I try, both values are plotted against the y axis. Any help greatly appreciated. Thanks Ket (PS I am using excel 2K on Windows 2K) Ket - You must select the bottom two rows of your data, then select an XY Scatter chart type in...

getting data labels on xy chart from additional plot area
I am creating a scatter chart that is designed to show trends in employee performance. Employees are rated with 2 different tools, each using a 5 point scale. I am able to plot the intersection of each tool rating without a problem. However, I would like to be able to add a data label that is employee name. When I add names to the data series, my xy chart now plots each tool as a separate data point, not as an intersection. So...when I use source data like below, the chart looks fine, but employee name is not included. Tool 1 Tool2 ------------------- 4 5 3 ...

Import from Adobe Acrobat 6.0
How do I import data from an Adobe Acrobat pdf file to Excel????? I have tried saving the file as plain text, accessible text and rich text. The file will not save with the proper formatting. Thanks, HT Hi you'll have to re-format your exported pdf file in most cases. Nothing much you can do against this. Ask the creator of the PDF file for the original version -- Regards Frank Kabel Frankfurt, Germany anonymous@discussions.microsoft.com wrote: > How do I import data from an Adobe Acrobat pdf file to > Excel????? I have tried saving the file as plain text, > accessible te...

Scatter Graph
I am using Excell 2000 Can anyone point me to a good description of how to create a scatter graph? I am trying to do my first scatter graph and it does not look right. HELP - HELP - PLEASE! Aurora Jon Peltier has a charting tutorial that may help you: http://www.peltiertech.com/Excel/ChartsHowTo/Charting101.html Aurora wrote: > I am using Excell 2000 > > Can anyone point me to a good description of how to create > a scatter graph? I am trying to do my first scatter graph > and it does not look right. HELP - HELP - PLEASE! -- Debra Dalgleish Excel FAQ, Tips &am...

Archiving #6
Any best practise in archiving exchange email to .pst and backup to server without users intervention. I have this problem with users archiving pst till 6-7GB. I wish i can break it up and backup to server, and users still have a local copy On Tue, 14 Nov 2006 18:38:47 +0800, "James Lau" <james@viperlink.com.sg> wrote: >Any best practise in archiving exchange email to .pst and backup to server >without users intervention. >I have this problem with users archiving pst till 6-7GB. I wish i can break >it up and backup to server, and users still have a local c...

Scatter chart
I am trying to create a scatter chart for names on a map(boats in a boat yard) I want to supply the x & y values of the boat position and have the name of the boat displayed at that point. Is it possible, because I am finding if I supply x & y values Excel seems to interpret that as 2 series of numbers Help gratefully received Thanks Phil Let's say your Boat names are in A2:A10, the X value is B2:B10 and the Y Value is C2:C10 Create a scatter chart for your X Y values as you would normally do. You'll need an addon like Rob Bovey's XYChartLabeler. It can be f...

How do I put multiple colors in a chart's plot area
For instance, if I have a single series chart with Y axis from 0% to 5%, how do I put a red color from 0 to 2%, green from 2 to 4% and blue from 4 to 5%? TonyU1234 I am not entirely sure what you need but can offer the following. I am assuming you have a simple line chart here. Two options (1) You can manually select data points and assign them a colour dependent upon value. Simple to do, but laborious if lots of data points (2) This VBA code may help. In simple terms, it loops through each data point, tests the value of the datapoint, and assigns a colour of red < 2%: green 2% - ...