PC Review


Reply
Thread Tools Rate Thread

Chart Question Using VBA

 
 
Sandy
Guest
Posts: n/a
 
      15th Aug 2008
How do I add a chart to he active worksheet? It always makes a new sheet.

Thanks
 
Reply With Quote
 
 
 
 
Tom Hutchins
Guest
Posts: n/a
 
      15th Aug 2008
In the code where you are creating the chart, use a .Location statement to
tell Excel to place the chart as an object on a specified sheet (in this case
the active sheet). For example,

Dim sht As String
sht$ = ActiveSheet.Name
Charts.Add
ActiveChart.ChartType = xlColumnClustered
ActiveChart.SetSourceData _
Source:=Sheets(sht$).Range("A5:E26"), PlotBy:=xlColumns
ActiveChart.Location Where:=xlLocationAsObject, Name:=sht$

Hope this helps,

Hutch

"Sandy" wrote:

> How do I add a chart to he active worksheet? It always makes a new sheet.
>
> Thanks

 
Reply With Quote
 
Jim Thomlinson
Guest
Posts: n/a
 
      15th Aug 2008
Step 4 of the chart wizard asks you where you want the chart to land. Ensure
that it is object in ??? sheet and not as new sheet...
--
HTH...

Jim Thomlinson


"Sandy" wrote:

> How do I add a chart to he active worksheet? It always makes a new sheet.
>
> Thanks

 
Reply With Quote
 
Sandy
Guest
Posts: n/a
 
      15th Aug 2008
Tom, Thankyou - worked perfectly.

Can you tell me how to place the chart on the sheet where I want it?

Thanks again,

Sandy

"Tom Hutchins" wrote:

> In the code where you are creating the chart, use a .Location statement to
> tell Excel to place the chart as an object on a specified sheet (in this case
> the active sheet). For example,
>
> Dim sht As String
> sht$ = ActiveSheet.Name
> Charts.Add
> ActiveChart.ChartType = xlColumnClustered
> ActiveChart.SetSourceData _
> Source:=Sheets(sht$).Range("A5:E26"), PlotBy:=xlColumns
> ActiveChart.Location Where:=xlLocationAsObject, Name:=sht$
>
> Hope this helps,
>
> Hutch
>
> "Sandy" wrote:
>
> > How do I add a chart to he active worksheet? It always makes a new sheet.
> >
> > Thanks

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Chart question - how to display 3 series as a bar chart and oneseries as a line Dave K Microsoft Excel Discussion 1 9th Aug 2010 09:18 PM
chart question Gary Keramidas Microsoft Excel Programming 3 20th Oct 2008 12:26 PM
Pie Chart Question And Legend question =?Utf-8?B?UmVuZWU=?= Microsoft Access Reports 0 5th Aug 2005 04:46 PM
Custom color question + smooth chart curves question Gern Blanston Microsoft Excel Charting 2 14th Nov 2003 02:42 AM
Custom color question + smooth chart curves question Gern Blanston Microsoft Excel Misc 1 13th Nov 2003 01:02 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:39 PM.