Use a loop to create multiple Charts - Suggestions ?

I am running a loop in VBA which is supposed to draw a new chart fo
every (2) column(s) of data. 

However, I am not sure how to make it "jump" from column to column.
Part of my program (does not include the "For i=1 to3 e.t.c.) is below
The *high-lighted *part is the part I am trying to change. Instead of 
fixed reference I wanted to get the data I have in th
_underlined__part. Any suggestions???


Sheets("OUTPUT All data").Select

_Range(Cells(11,_2_*_i),_Cells(11,_2_*_i_+_1)).Select_  
Range(Selection, Selection.End(xlDown)).Select
Charts.Add
ActiveChart.ChartType = xlLineMarkers
ActiveChart.SetSourceData Source:=Sheets("OUTPUT Al
data").Range(Cells(11, 2 * i), Cells(11, 2 * i + 1)).Select
Range(Selection, Selection.End(xlDown)).Select_ 
PlotBy:=xlColumns
'ActiveChart.SetSourceData Source:=Sheets("OUTPUT Al
data").*Range("B11:C316") _*        , PlotBy:=xlColumns
ActiveChart.Location Where:=xlLocationAsNewSheet
ActiveChart.HasLegend = True
ActiveChart.Legend.Select
Selection.Position = xlTop
ActiveChart.ChartArea.Select
Selection.AutoScaleFont = Tru

--
APOE
-----------------------------------------------------------------------
APOEL's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=3690
View this thread: http://www.excelforum.com/showthread.php?threadid=56617

0
7/28/2006 8:53:03 PM
excel.charting 18370 articles. 0 followers. Follow

1 Replies
470 Views

Similar Articles

[PageSpeed] 45

Try this:

ActiveChart.SetSourceData Source:=Sheets("OUTPUT All data") _
  .Range(Cells(11, 2 * i), Cells(11, 2 * i + 1).End(xlDown)), _
  PlotBy:=xlColumns

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


"APOEL" <APOEL.2bob5t_1154120109.5196@excelforum-nospam.com> wrote in 
message news:APOEL.2bob5t_1154120109.5196@excelforum-nospam.com...
>
> I am running a loop in VBA which is supposed to draw a new chart for
> every (2) column(s) of data.
>
> However, I am not sure how to make it "jump" from column to column.
> Part of my program (does not include the "For i=1 to3 e.t.c.) is below.
> The *high-lighted *part is the part I am trying to change. Instead of a
> fixed reference I wanted to get the data I have in the
> _underlined__part. Any suggestions???
>
>
> Sheets("OUTPUT All data").Select
>
> _Range(Cells(11,_2_*_i),_Cells(11,_2_*_i_+_1)).Select_
> Range(Selection, Selection.End(xlDown)).Select
> Charts.Add
> ActiveChart.ChartType = xlLineMarkers
> ActiveChart.SetSourceData Source:=Sheets("OUTPUT All
> data").Range(Cells(11, 2 * i), Cells(11, 2 * i + 1)).Select
> Range(Selection, Selection.End(xlDown)).Select_ ,
> PlotBy:=xlColumns
> 'ActiveChart.SetSourceData Source:=Sheets("OUTPUT All
> data").*Range("B11:C316") _*        , PlotBy:=xlColumns
> ActiveChart.Location Where:=xlLocationAsNewSheet
> ActiveChart.HasLegend = True
> ActiveChart.Legend.Select
> Selection.Position = xlTop
> ActiveChart.ChartArea.Select
> Selection.AutoScaleFont = True
>
>
> -- 
> APOEL
> ------------------------------------------------------------------------
> APOEL's Profile: 
> http://www.excelforum.com/member.php?action=getinfo&userid=36903
> View this thread: http://www.excelforum.com/showthread.php?threadid=566172
> 


0
jonxlmvpNO (4558)
7/29/2006 2:36:27 AM
Reply:

Similar Artilces:

How chart time scale x-axis with another date serie
Hello all. I have this problem, I will need to create this chart that I don't know how to. Serie 1 is below which needs to be time scaled Date Count 1/1/2006 12 1/2/2006 3 1/3/2006 5 2/1/2006 18 2/3/2006 4 2/18/2006 9 4/1/2006 18 7/4/2006 38 Serie 2 - needs to plot the three dates in serie 1's time scaled X-Axis with symbols. 1/31/2006 2/18/2006 4/2/2006 I will look something like you have a line of count on a time-scaled chart, with 3 dates point in the x-axis. Please ...

user created shapes non printing
I started have a problem with vision 2002 that I have not noticed before. When I create a new shape, by default, it assumes the non-printing properly under FORMAT � BEHAVIOR. Also if I group a set of "printing" shapes the group will become non-printing. Can I change this behavior? How are you creating the new shape? Also are you using layers in your document? -- Mark Nelson Microsoft Corporation This posting is provided "AS IS" with no warranties, and confers no rights. "Robert" <hammer_757@hotmail.com> wrote in message news:9ec427f7.0409231005.576...

How to create a partition on an external USB drive?
Toshiba Tablet XP Home/Student with plenty of memory. I have the program DriveImage XML. At one point it says to create a partition somewhere for the image it's going to create. I have a 40G external plug and play HD. I'd like to create a partition on it without disturbing other files and folders I have on it. There's plenty of free space. Various resources say use XP Disk Management to create that partition. So when I go there it appears as they say but when they say click on the free space choose the selection "Create new partiton." I have right clicked ...

Copy field data to multiple places
Newbi here.... I have a access 07 file of about 1000 records (rows) and a field (column) I'll call the "project number". All the records do not have the project number inserted as of yet. Is there a simple means to insert a project number in say 50 records at a time, another project number in another 75 records etc. Copy/Paste will do it but may take months to enter. Any suggestions appreciated. TIA On Wed, 27 Feb 2008 15:31:05 -0500, "Meebers" <justme@idontkno.com> wrote: >Newbi here.... I have a access 07 file of about 1000 records (rows) and ...

last 4 wk average using calculated pivotitem
Hi, I am trying to create a pivot table/chart from data that is listed b week. So my table has "week" as the row field and "total X" as th column field. I want the chart to display the total for each week as bar (the easy part) and also to graph the average of the last fou weeks as a line on top of the bar graph. I have tried to figure ou how to add a calculated pivot item but I can't seem to get it to wor right. So for each week there would be a second almost subtotal lik entry that calculates the average for the previous four weeks (if ther aren't four previo...

"All users" "Programs" create/modify shortcut from app...
Hi all, I've created two shortcuts into "Programs" folder for "All Users" It lets me to get them available for all user. The problem: Application running in "User" context needs to delete and re-create such links but it fails due to an "access denied" ... Settings correct permission to such links it starts working as well I've created links using the IShellLink/IPersistFile sehll interfaces. So, I actually need to have link under "programs" for "All Users" which might be modified by application running in "Users"...

SQL Back-end / Access Front-end using linked tables????
I have a backend that contains tables that I pull Driver information, Customer information , etc. (these are MAS 200 accounting software tables that are exported nightly to the SQL backend). I also have on the backend tables that I push information to; information that we enter on the forms located on the front end. I might not have this set- up correctly, but I'm linking all tables on the back end to the Access database on the front end. When trying to set up an Auto Lookup off of a query I've created in Access it says I need to go into the table change Data Type to the Lookup wizard,...

How to create a connection point in Excel
When I group autoshapes the group itself does not have connection points. A connector connects to one of the grouped shapes instead. So, the connector beginconnecedshape (or endconnectedshape) property contains the name of the contained shape and not the name of the group. Is there a way to create connection points for a group? Alternatively, is it possible to change a group into a single shape with connection points? ...

Is your microsoft office outlook download update looping?
-- PackersFAN In article <3F7B4D82-187F-4022-BF52-C085A98CF410@microsoft.com>, lambeau@discussions.microsoft.com says... > If you're talking about the outlook (hotmail) connector - yep - that's what it does for several of us it seems. Use this link: http://www.microsoft.com/downloads/details.aspx?FamilyID=39db2b89-af2e- 41f9-a175-f93e1377959f&displaylang=en Or if you cannot unwrap, get the link is connected to from this page: http://office.microsoft.com/en-au/outlook/HA102225181033.aspx -- Duncan. Yes, I am experiencing same thing. "...

Using a VBscript to copy/delete/move Outlook messages
I need to write a VBscript to: - open my Outlook (2000 or XP) mailbox - read the list of the folders in either the Exchange Mailbox and in local ..pst files - open each folder and subfolders - read information about messages (i.e. sender, recipient, creation date, and so on) - move, copy or delete messages based on the above information Can anybody please provide a pointer to a sample I can start from? Regards Marius ...

Using XP Briefcase with money file
I put a copy of my money file into the laptop briefcase and I am able to keep them in sych for a while. For some reason I get locked out, the computer knows the file has been updated but it will not let the desk top file update the laptop file, I get the following message; "The source file can not be opened" "Check to see if the other program has the file opened, and close the file before updating the briefcase." Other files update just fine. When I get this message, I can't even drag a new copy of the Money file to my briefcase, I have to rename the file an...

Createing Quote sometimes make Error: 80070057
Hello NG, Today I found some funny problems. I create Quotes via the quote WebService from the CRM. This normally works fine, but now I have some quotes, which will get me an error, when I open it. This error is no normal error, I will get an white/yellow Page with ASPX Errorpage: Here the Message (sorry but I only have this error in German): Serverfehler in der Anwendung '/'. ---------------------------------------------------------------------------- ---- Falscher Parameter. Beschreibung: Beim Ausf�hren der aktuellen Webanforderung ist ein unverarbeiteter Fehler aufgetret...

Change color of multiple autoshapes
I need to change the color of several autoshape based on different cells I know how to change one autoshape using a worksheet_change event but i can't just copy and paste this and change the object name + cell name. is it possible to have multiple worksheet_change events in the same worksheet?? T-bone, You have only one worksheet_change event, but in it you can test to see which cell was changed with something like If not Intersect(Target, Range("A1") is nothing then ' do range A1 stuff here end if If not Intersect(Target, Range("A2") is nothing then &#...

Exchange Features Tab in ADUC when using Windows 2000 SP3
Hi, I would like to run Active Directory Users and Computers with Exchange 2003 Admin tools I'm limited to Windows 2000 Prof/SP3 Everything works,except from the Exchange Features tab. When selecting this tab, ADUC hangs. Any ideas. (I have to stay on SP3!) br TN Terminal Services is always my first choice. On Wed, 13 Apr 2005 23:35:22 +0200, "newsMS" <t_n@trashcan.dk> wrote: >Hi, > >I would like to run Active Directory Users and Computers with Exchange 2003 >Admin tools >I'm limited to Windows 2000 Prof/SP3 > >Everything works,except...

How do I add multiple times together
Hi does anyone know how I can add multiple times togther and get the anser in hours and minutes. I have formatted the cell for time however when I atosum I keep getting an answer that is incorrect. Any help? Thanks D Maybe it was just a formatting problem. Try a custom format of: [hh]:mm Playhouse pm wrote: > > Hi does anyone know how I can add multiple times togther and get the anser in > hours and minutes. I have formatted the cell for time however when I atosum I > keep getting an answer that is incorrect. Any help? > Thanks > D -- Dave Peterson ...

Creating Control Grid
Hi all, I would like to know as to how I should go about creating a control grid of my very own. I just need a bit of push (suggestions). Thanks In Advance Where are you getting stuck? Of course, if the grid isn't too large and most of the cells will have data, then you could simply use a two-dimensional array. For larger grids that will be sparsley populated, there are a couple of algorithms to consider. A simple one is to create a one-dimensional array that represents the rows (or columns), and have each item contain or reference a linked list for all items in that row (complete...

Using a variable for a chart limit
Since I got instant help on my last query, is there any way to use a cell reference as an axis minimum or maximum in format axis? It seems impossible, but there is a lot of experience out there. Thanks in advance. -- Vince F Hi, See Jon's information http://peltiertech.com/Excel/Charts/AxisScaleLinkToSheet.html Cheers Andy Vince F wrote: > Since I got instant help on my last query, is there any way to use a cell > reference as an axis minimum or maximum in format axis? It seems impossible, > but there is a lot of experience out there. Thanks in advance. -- Andy Pop...

How do I make door hangers using publisher?
Is this even possible? Mary Sauer has a website with a generous collection of goodies including door hangers. Take a look at just above George Washington's portrait (way down the page) at, http://msauer.mvps.org/publisher_projects2.htm -- Don - Publisher 2000� Vancouver, USA "medinapie" <medinapie@discussions.microsoft.com> wrote in message news:986B8199-C9B5-46CE-8F2F-C772BE5C21BC@microsoft.com... > Is this even possible? I have a sample on my web page. Scroll down -- on the left. http://msauer.mvps.org/graphics.htm Some cute ones here that you could mod...

multiple instances of IE on same site
I have winxp and use IE 8. My problem is that I have 2 usernames on some web forums. I used to be able to login using both usernames and have both instances running simultaneously. Now I can't. Everytime I'm logged in and try to initiate another instance the username just changes. It does not allow me to open 2 IEs with 2 usernames at the same time. I'm pretty sure this is just a setting but I don't know where it is. The reason I think it's an IE setting is that when I try to login with a competitor browser as the 2nd user...it allows it. Any help would be gre...

Multiple entries in CRM Contacts when viewed from Outlook
Hi everyone, We have an odd problem going on here with this. When we create a new E-mail in Outlook, select the To button and the CRM Contacts, it brings up the list of contacts from CRM that we can select from. All good so far. The problem is that each contact appears several times and it's different for different users. For example, every contact appears 6 times for me. It makes for a very long list. All of them are valid and any one of those 6 can be selected and the address will be correct and it will track against the correct contact. Other users have anywhere from the correc...

using program to record audio comment and compress audio to MP3
I can use VBA to record an audio comment into a Word file using Selection.InlineShapes.AddOLEObject ClassType:="SoundRec", FileName:="", _ LinkToFile:=False, DisplayAsIcon:=True, IconFileName:= _ "C:\WINDOWS\system32\sndrec32.exe", IconIndex:=0, IconLabel:="Wave Sound" BUT but by default the file is stored as a PCM at 44kHz and 16 bit stereo whcih is about 200kB per second Sound recorder (which is used to do the recording) allows me to manually convert this to a MP3 and a much smaller file e.g. 3kB per second Is there any way I can aut...

eConnect or Web Servies to create RMTransaciton?
Hello, I am new to GP 9.0 development using web services and eConnect. Can someone help me decide which technique I can use to do the following: In GP 9.0, if I go to: Transactions-->Sales-->Transaction Entry brings up the Receivables Transaction Entry screen, where I can fill in a number, batchid, customerid, and some sales figures, etc. I am using .NET and can use the eConnect API to create a taRMTransaction to submit using eConnect. And it works fine, the transaction creates in GP. Can I perform the same thing with any of the web methods available via the GP 9 web services? I ca...

Can I use oulook from home and have access at work?
When I set up my outlook I lose all my inbox messages online and would not be able to read my email from work. Is there a way to have my inbox available on outlook and remain online? Just to clarify, are you asking how to set up Outlook at home to receive email from work? If that's your question, you need to ask your IT Admin or Exchange Admin if you can use OWA and how that's done. That wouldn't have email coming into your Outlook account but it is a form of Outlook, Outlook Web Access. This may or may not be allowed. Your IT staff would of course have all kinds of securi...

Manual for beginners -- Charts with Excel
You may find useful a training manual I wrote for making charts in Excel. The manual is for beginners to intermediate users. [So, no VBA and dynamic ranges and stuff]. Great for teaching college students or self-mastering the Excel Charts facility. In any case, the book is free at http://www.vgupta.com VJ ...

Excluding multiple checking accounts from budget totals?
Howdy! Running Money06, and I have two checking accounts synching through Bank of America. Everything there is working well, but one thing that I dont like is that the totals for BOTH accounts are added together. I have two accounts, 'personal' and 'class', and both accounts are shown in the net balance statements, the 'spending by catagory' chart on the home page etc. I would like to keep synched with my class account, but want it excluded from all of the balances.. any suggestions? "Raichean" <Raichean@discussions.microsoft.com> wrote in mes...