Help Programming an XY scatter Chart

I have a user form that inputs data onto a spreadsheet. I have a
command button that runs a macro that activates the sheet, selects the
data, and creates the XY Scatter chart. My Problem is that I don't know
how to set a loop to set each series' properties . (The number of
series changes every time) Bellow is an example where I manually set
the properties for three of the series. Any Ideas on how to create a
loop to set all.

Range("A:A,C:C,D:D").Select
    Range("D1").Activate
    Charts.Add
    ActiveChart.ChartType = xlXYScatter
    ActiveChart.SetSourceData
Source:=Sheets("Sheet1").Range("A1:A15,C1:D15"), _
        PlotBy:=xlRows
    ActiveChart.SeriesCollection(1).XValues = "=Sheet1!R2C4"
    ActiveChart.SeriesCollection(1).Values = "=Sheet1!R2C3"
    ActiveChart.SeriesCollection(1).name = "=Sheet1!R2C1"
    ActiveChart.SeriesCollection(2).XValues = "=Sheet1!R3C4"
    ActiveChart.SeriesCollection(2).Values = "=Sheet1!R3C3"
    ActiveChart.SeriesCollection(2).name = "=Sheet1!R3C1"
    ActiveChart.SeriesCollection(3).XValues = "=Sheet1!R4C4"
    ActiveChart.SeriesCollection(3).Values = "=Sheet1!R4C3"
    ActiveChart.SeriesCollection(3).name = "=Sheet1!R4C1"
    ActiveChart.Location Where:=xlLocationAsNewSheet, name:="xyCart"
    With ActiveChart
        .HasTitle = True
        .ChartTitle.Characters.Text = "risk"
        .Axes(xlCategory, xlPrimary).HasTitle = True
        .Axes(xlCategory, xlPrimary).AxisTitle.Characters.Text =
"Impact"
        .Axes(xlValue, xlPrimary).HasTitle = True
        .Axes(xlValue, xlPrimary).AxisTitle.Characters.Text =
"Probability"
    End With
    With ActiveChart
        .HasAxis(xlCategory, xlPrimary) = False
        .HasAxis(xlValue, xlPrimary) = False
    End With
    ActiveChart.Axes(xlCategory, xlPrimary).CategoryType = xlAutomatic
    With ActiveChart.Axes(xlCategory)
        .HasMajorGridlines = True
        .HasMinorGridlines = False
    End With
    With ActiveChart.Axes(xlValue)
        .HasMajorGridlines = True
        .HasMinorGridlines = False
    End With
    ActiveChart.HasLegend = False
End Sub

0
3/21/2006 10:15:14 PM
excel.charting 18370 articles. 0 followers. Follow

0 Replies
735 Views

Similar Articles

[PageSpeed] 42

Reply:

Similar Artilces:

Query Help for No Vendor Associated with Items
Can someone help me write a query to find the items in the database that do not have a supplier associated with them? SELECT * FROM ITEM WHERE SupplierID=0 - Evan Culver New West Technologies "Bill Fry" <BillFry@discussions.microsoft.com> wrote in message news:9090FB52-0AF9-49FF-AA57-72A73551AB1A@microsoft.com... > Can someone help me write a query to find the items in the database that > do > not have a supplier associated with them? Thanks. I imported my Database and used one of my normail vendors number when I imported it. The problem is when I view the...

Updating charts in Excel
For some reason, my charts no longer seem to update when the source data itself is updated. The source data cells are actually formulas themselves, but they are updating with the new information just fine. It's very strange that the table the values are drawn from have changed and are current but the chart itself still shows old numbers. The only way I can fix it is to right click, select source data, then re-enter the source data cells. (Actually I change one cell and then change it back and it updates.) Does anyone have any idea why my workbook is no longer updating cells? By...

How do I get a column to appear along the horizontal axis of chart
I have two adjacent numerical columns; when I select them to create a chart Excel chooses to plot both columns vertically side by side. Instead of that I want the left column to appear along the bottom of the chart and the right column to be vertical. This is probably very simple but it is doing my head in. Any suggestions most appreciated. Hi, Sounds like it's a Scatter graph you want to produce - just select XY (scatter) as your chart type and it should get the result you want. You can then add a trend line to get linear representaion of your data. Hope this works/helps. Andr...

when the size of view change,how can I also change size of the font,chart in this view
all: I want to change the size of font and chart go with the view's size changing. what can I do . thx for anyone respone. &best regards. terrcy.j terrcy wrote: > all: > > I want to change the size of font and chart go with the view's size > changing. > > what can I do . > > > thx for anyone respone. > > &best regards. > > terrcy.j > > Handle the WM_SIZE message in the view. It is passed the new size. To change the font you will have to call the CFont's DeleteOjbect, then cal...

Need Help with this Error Message....
I just purchased Office X.v and installed it onto my Mac. I also removed Office Test Drive before installing the full Office X.v, but i didn't empty my trash. So after I installed the full version i keep getting the error "An unexpected error occurred while trying to load Microsoft Framework X library" on all office programs. I read on mactopia that this could be caused by "lock" identities in the microsoft identity file, but all of mine are unlocked. When i tried to empty my trash, it would not empty a few microsoft file because it says they are in use. Framework ...

Help with Formula #3
Hi all How do I express this as a formula in Excel: In P2: If the value in C12 appears in the range C9:H9 then 1 otherwise 0 Hope this makes sense TIA George One way: =--(COUNTIF(C9:H9,C12)>0) In article <eg7FUa4GFHA.3908@TK2MSFTNGP10.phx.gbl>, "George Gee" <george.nomaps@ntlworld.xom> wrote: > Hi all > > How do I express this as a formula in Excel: > In P2: If the value in C12 appears in the range C9:H9 then 1 otherwise 0 > > Hope this makes sense > > TIA > > George Many thanks, such a speedy reply. Have a drink on me...

HELP Cannot Filter "Category" when discounting MANY items
Hello, our reseller and I are working on this, but so far; All PCs and server are RMS SP2, all clients are W2K or XPPro in a W2K domain setting. All PCs and server highly stable, SQL2K-sp2, very stable, no bugs. When picking items for Discount, we go StoreManager\Inventory Wizard\Change Item Prices\"Items in this Filter". We have 65000 items, so individual or manual entry is not an option except to add to already discounted groups. The filter finds nothing when choosing options in the filter that includes the term - Category. Items are in very large Departments, then ea. Dept...

TRUE/FALSE NUMBER CLOSER/NEARER??-please help anyone
hi all, can anyone help me with this problem. i am after a formula that produces a TRUE or FALSE when 2 or mor different numbers are the closest to the objective number. below are some examples. 500 is 275 closer to 500 than 400:answer: FALSE is 400 closer to 500 than 275:answer :TRUE basically the formula should be like this:which is closer to 500, 27 (false) or 400 (true). or 15 is 16 closer to 15 than 17:answer:TRUE is 17 closer to 15 than 16:answer:FALSE hope everyone can understand the examples. i also help someone out there can help me with this formual. thankyou for reading this THR...

Help w/formulas
Hi there - ok, I am working on a VERY LONG tedious workbook for my office. I am beginner to formulas, in fact - the only thing I know how to do (an needed to do, I thought, for this workbook) was display text fro another sheet. I have a main sheet called: Info, and then I have several sheets tha follow and all of them pull some information from the Info Sheet. It' to help us quickly fill out several forms that my company requires, bu seem redundant - so now - we'll be able to fill out the Info sheet an all the other forms will pretty much fill themselves out. They al relate to p...

Charting Smoke drift in winds based upon varying speed and altitud
Does anyone have any idea how Excel might be used for the subject problem. Hoping to get some sort of a chart that would show a predicted downwind pattern of smoke particles at a particular distance based upon wind speed. -- Thanks, Jerry Presumably you have a model that makes numerical predictions of smoke particle distributions? If so, you need to think of a way to graphically display this predicted data. - Jon ------- Jon Peltier, Microsoft Excel MVP Tutorials and Custom Solutions http://PeltierTech.com _______ "Jott" <Jott@discussions.microsoft.com> wrote in messa...

SSL tunneling..pls help
Hi, I have my OWA wesite on internal server behing DMZ. My Isa server is in DMZ I have few internet client that will be accessing OWA via ISa server. I plan to use SSL tunneling In that case, how mayn certificates i require? Do i need for ISa and web server both? You will need one certificate and that will be installed on your Exchange server and your ISA server. Create the request for the certificate, import the certificate and then export it and import it into the other machine(s). Nue "Jack Dorson" <JackDorson@discussions.microsoft.com> wrote in message news:8EBF5...

VBscripting OL2000 client with .asp on iis5 ? Help needed..
Trying to do what Ebay does with making links to add appointment with reminder via html/asp page.. but with no luck.. The page executes but nothing happens.. any advise would be appreciated.. Server vs Client scripts ? Help appreciate.. <%@ Language=VBScript %> <HTML> <HEAD> <META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0"> </HEAD> <BODY> <SCRIPT LANGUAGE=vbscript> Dim olApp Dim oAppt Dim objRecip Set olApp = GetObject(, "Outlook.Application") Dim olNs Set olNs = olApp.GetNamespace("MAPI") Set o...

OpenRecordSet syntax help
Hello, I have a counter on my switchboard that runs with the following code: Function MissingEntryCountRecords() As Long Dim db As DAO.Database Dim rst As DAO.Recordset Set db = CurrentDb Set rst = db.OpenRecordset("Select * From havecrf Where (formstat = 2 & isnull(page) = False)") rst.MoveLast MissingEntryCountRecords = rst.RecordCount End Function If I leave at just 'formstat = 2', it works great, but I also need to check if the field 'page' is null and I just can't seem to get the syntax correct. Is it possible to get a second condition into the...

Pivot charts in powerpoint
Hi, I'm trying to create a presentation that includes pivot charts. The reason I want to do this is that there are numerous permutations to cover - thus the pivot. In the interim I have copied the charts as a link - but this is not ideal because I have to keep going back to the spreadsheet which looks messy during a presentation. It would be great if the pivot chart filter could be used in ppt. I'm using PPT 2007. Thanks, Graeme Open the custom animation pane. Select the Excel object on the slide. Choose Add Effect | Object Actions | Open (or Edit -- I don...

Help: Creating a Variance column within a Column Group
Good Evening All, Using SSRS 2008 and Report Builder=85 I have a recordset of financial transaction over the last two years (2010, 2009) that I am presenting in a tablix. The tablix has a =93row group=94 where I am grouping on product type, and a =93column group=94 that I am grouping on year(transaction date). So when I expand the report, the resulting report looks something like this: Product +2010 +2009 Item 1 $10000 $8000 Item 2 $5000 $4000 Item 3 $30000 $25000 So now what I need is to do a variance between the two years, but for the life of me I can=92t figu...

data labels in xy scatter
Hello- Is there any way to label individual points in an XY scatter with data from ajdacent cells? For exampl, I have 3 columns with a name, an x value and a y value. I want to plot points with the XY data and label each point with the names from the first column. Seems simple but I can't figure it out I use Rob Bovey's XY Chart Labeler when I want to do this. http://www.appspro.com/Utilities/ChartLabeler.htm "kbpratt" <kbpratt@discussions.microsoft.com> wrote in message news:1DC38D4D-5655-457C-977E-42520031AC67@microsoft.com... > Hello- > > Is there ...

"Program Does Not Exist" message (2nd Post)
PLEASE PLEASE PLEASE somebody help me figure this out. I have posted this question twice already: Hello. I have a command button on a form. Behind the button is code to Application.FollowHyperlink stDocName When the user presses the button, it is supposed to follow a hyperlink created from the text in certain fields on the form to open a file in a folder. A message box then pops up warning about the dangers of hyperlinks. However, if the button is pressed and the hyperlink does not match a file, a message box pops up saying Program Does Not Exist. All of this works just fine EXC...

Cells not recognised for charts
I have a table of public domain data from Nomis (The UK Gov't office that provides data on employment). I have created the table manually and it works fine. The Nomis one will not display as a chart. I have copied the formatting of the manual one to the Nomis version, so it's not that. All cells are 'general' in both tables. If I double click in each cell, it does something to it and it will then be recognised but I cannot see anything which tells me what the difference is before and after. If anyone can help me understand what the issue is, and even better, how to solve i...

Excel chart, changing into sections to color
I have a line chart. The user is dividing the chart, manually, with verticle lines. In one section, he wants the chart to be red, in the next section he wants it blue and the third section he wants it yellow. I think it's a neat concept but in trying everything I can think of, I'm not thinking it's possible. The lines color cannot be changed mid-stream. Any thoughts?? Do you want the lines or the background to change color? Here are examples showing in principle how to change colors behind the lines: http://peltiertech.com/Excel/Charts/ChartIndex.html#Background - Jo...

please help me #2
hi all i am facing some issue with my Microsoft 2007 outlook,whenever i try to open it ,i got an error message ""the Add-in "NOD32 Emon" (C:\PROGRA~1\Eset\Emon.dll) can not be loaded and has been disabled by outlook, please contact the Add-in manufacturer for an update.if no updates is available,please uninstall the Add-in else i did all,,,i uninstall nod32,even i uninstall outlook but nothing happened as such even i also followed your earlier steps MS Outlook closed, delete extend.dat in %User profile%\Local Settings\Application Data\Microsoft\Outlook - run regedit and ma...

Conditional formatting help required please
I have a spreadsheet where cell C& requires the user to enter either "Y" or "N". Depending which they enter I need to recolour cells B7:B12. I have completely run out of ideas for how to do this - Excel bible, web searches etc. have not solved the problem. Can someone please please put me out of my misery - I know it can be done and I'm sure its simple (when you know how)? Many thanks Tony (now you know why I log in backwards ... ynoT !!!) -- y_not ------------------------------------------------------------------------ y_not's Profile: http://www.excelf...

"File Group Is Full" help!!
I get the following error when I log onto POS. " Error #-2147217900. Could not allocate space for object 'Journal' in database because the "Primary" file group is full" My server has 90Gigs of free space. I set up my database to grow automatically. What do i do? Thanks What version of SQL are you using, MSDE, SQL 2005, etc.? "Tony" <sales@windovers.com> wrote in message news:8BCDDCC7-C24C-421C-BF57-3B217088D913@microsoft.com... >I get the following error when I log onto POS. " Error #-2147217900. Could > not allocate space for objec...

Word doc will not delete from print Q (Word 2000) help please
I can not delete a word doc from the print Q. (It is word 2000) It has been there for 2 days and states deleting...P but will not delete and printer will not operate, can anyone please advise how to fix. Thank you. Sorry, the print queue is not handled by Office but by the operating system. Try turning off the printer and the computer and restarting both. Diane wrote: > I can not delete a word doc from the print Q. (It is word 2000) It has been > there for 2 days and states deleting...P but will not delete and printer will > not operate, can anyone please advise ...

Third Party Charting Add-ons/Plug-ins/Controls
Can somebody suggest any third party Charting Add-ons/Plug-ins/Controls that expand the charting capabilities of MS Excel? Such that may be code-controlled in VB or VBA. Hans Hans - What is it you are trying to accomplish? The capabilities of Excel charting are broader than most people imagine. - Jon ------- Jon Peltier, Microsoft Excel MVP Peltier Technical Services Tutorials and Custom Solutions http://PeltierTech.com/ _______ Hans Wolf wrote: > Can somebody suggest any third party Charting > Add-ons/Plug-ins/Controls that expand the charting capabilities of MS > Excel? >...

Special chart
Hi everybody I'm getting desperate, trying to make a non standard chart with excel It's so simple i don't get why i can't achieve to do it. I join a jp of the chart i'm thinking of (not enough confident with my english t try to explain it here !). You guys sure know how to make it : actually, it's very very ver important for me (three years of study nearly depend on it !). Thank u all by advance Seamu Attachment filename: dd.jpg Download attachment: http://www.excelforum.com/attachment.php?postid=40519 -- Message posted from ht...