LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Report Post  
Jon Peltier
 
Posts: n/a
Default

Chris -

1) I made the code so it used the entire used range of the active sheet.
To work only on a selected region, change this line

Set rUsed = ActiveSheet.UsedRange

to this

Set rUsed = Selection

2) cht.Name fails when you try to name a sheet with the name of an
existing sheet, or if the cell has illegal characters or too long a
string for a sheet name (limit = 31 characters). Delete that line and
name the charts when you're finished.

3) Control the chart type by inserting this line after Charts.Add:

cht.ChartType = xlXYScatterLines

Actually, once you type the = sign, you get an intellisense dropdown
with all of the available chart types listed.

Another hint. Don't throw away the macro recorder. When your code is
pretty good but you want to change one or two things, turn on the
recorder while playing with a dummy chart, then get the code you need
from the recorded macro.

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


Chris Gregory wrote:

Hi Mr. Peltier,

I am a biology graduate student with a similar problem as rabidchild. As
this is the first time I am attempting to create a macro without the benefit
of "Recording", I'd like to ask you a few questions about your solution:

1) What cells should be highlighted when running this macro? If I highlight
more than one row (other than the column headings), everything is added onto
one chart (different column per row header). I would like it so that there is
a different chart per page & think that maybe I am highlighting something
incorrectly.

2) Are there any parts of your code that need to be replaced by me before
running it ("Placeholders" for variables inherent to my document only)? For
example, I keep getting an error (regardless of what cells I highlight), &
when debugged, Excel refers to the " cht.Name = rVal.Cells(1, 1)" line.

3) Is there a way to switch from a column chart to an x-y scatter plot in
your code?

Most of these questions are probably easy, but I'm not yet sure how to make
my way around the VB code. Eventually I would like to figure out how to
change defaults (i.e. whether or not a legend displays, what view percent is
set) or even utilize dynamic charting (create all my charts once & then have
them all update as I add new species [column headings] or measurements [row
headings]). Small steps first...

Thank you (or anyone else) for your response,

Chris

 
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
Create a print macro that would automatically select print area? wastedwings Excel Worksheet Functions 7 August 22nd 05 10:36 PM
How do I create two stacked column graphs together? Sarath GS Excel Discussion (Misc queries) 5 July 8th 05 11:55 AM
How do I create a formula in excel to automatically copy text fro. ijgolding Excel Discussion (Misc queries) 1 January 31st 05 12:37 PM
How do I create spreadsheet that automatically updates numbers/va. bunyip Excel Discussion (Misc queries) 2 December 8th 04 11:54 AM
How do I create a button or control that will automatically go to Roger Excel Worksheet Functions 1 October 29th 04 01:31 AM


All times are GMT +1. The time now is 02:15 AM.

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"