PC Review


Reply
Thread Tools Rate Thread

Creating and setting location for Excel Charts

 
 
Zzzbla
Guest
Posts: n/a
 
      4th Jul 2003
Hi!

I have to write some code that's supposed to create a report in Excel,
where some of the reports will contain more charts and some less (because
they have less data) and I have to create the charts programmatically
ofcourse.

My problem is that I couldn't figure out how to set the location of the
chart so it will be for example under a sepcific row in the sheet.

Please post an answer!

Thanks in advance!
 
Reply With Quote
 
 
 
 
Andy Pope
Guest
Posts: n/a
 
      4th Jul 2003
Hi Zzzbla,

Use something like this,

ActiveSheet.ChartObjects(1).Left = Range("E5").Left
ActiveSheet.ChartObjects(1).Top = Range("E5").Top


Zzzbla wrote:
> Hi!
>
> I have to write some code that's supposed to create a report in Excel,
> where some of the reports will contain more charts and some less (because
> they have less data) and I have to create the charts programmatically
> ofcourse.
>
> My problem is that I couldn't figure out how to set the location of the
> chart so it will be for example under a sepcific row in the sheet.
>
> Please post an answer!
>
> Thanks in advance!


--

Cheers
Andy

http://www.andypope.info

 
Reply With Quote
 
Zzzbla
Guest
Posts: n/a
 
      6th Jul 2003
Thanks a bunch!

I didn't figure there's a difference between Chart and ChartObject...

Almost copied charts to Word as a last resort...

Thanks again,
Zzzbla



In article <eJ$(E-Mail Removed)>, (E-Mail Removed)
says...
> Hi Zzzbla,
>
> Use something like this,
>
> ActiveSheet.ChartObjects(1).Left = Range("E5").Left
> ActiveSheet.ChartObjects(1).Top = Range("E5").Top
>
>
> Zzzbla wrote:
> > Hi!
> >
> > I have to write some code that's supposed to create a report in Excel,
> > where some of the reports will contain more charts and some less (because
> > they have less data) and I have to create the charts programmatically
> > ofcourse.
> >
> > My problem is that I couldn't figure out how to set the location of the
> > chart so it will be for example under a sepcific row in the sheet.
> >
> > Please post an answer!
> >
> > Thanks in advance!

>
>

 
Reply With Quote
 
Jon Peltier
Guest
Posts: n/a
 
      8th Jul 2003
To augment Andy's much more prompt response.

You can set the position and size of a chart when creating it in VBA.

Dim myChtObj As Chart Object
With ActiveSheet
Set myChtObj = .ChartObjects.Add(.Range("E5").Left, _
.Range("E5").Top, .Range("E5:L22").Width, _
.Range("E5:L22").Height)
End With

- Jon
-------
Jon Peltier, Microsoft Excel MVP
http://www.geocities.com/jonpeltier/Excel/index.html
_______

Andy Pope wrote:
> Hi Zzzbla,
>
> Use something like this,
>
> ActiveSheet.ChartObjects(1).Left = Range("E5").Left
> ActiveSheet.ChartObjects(1).Top = Range("E5").Top
>
>
> Zzzbla wrote:
>
>> Hi!
>>
>> I have to write some code that's supposed to create a report in Excel,
>> where some of the reports will contain more charts and some less
>> (because they have less data) and I have to create the charts
>> programmatically ofcourse.
>> My problem is that I couldn't figure out how to set the location of
>> the chart so it will be for example under a sepcific row in the sheet.
>>
>> Please post an answer!
>>
>> Thanks in advance!

>
>


 
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
Charts - Excel Spreadsheet location =?Utf-8?B?RkJ4aWlp?= Microsoft Powerpoint 1 15th Oct 2007 04:59 PM
Control size and location of Tables and Charts Linked to PPP from Excel Harold Microsoft Excel Programming 1 9th Jan 2007 03:56 AM
Creating charts in Excel... wardnine@hotmail.com Microsoft Excel Misc 1 2nd Jul 2006 07:42 AM
Creating Excel Charts =?Utf-8?B?RGVyZWsgV2l0dG1hbg==?= Microsoft Access VBA Modules 4 11th Dec 2004 12:57 PM
Creating charts in Excel Chad Microsoft Access External Data 1 22nd Oct 2003 10:40 PM


Features
 

Advertising
 

Newsgroups
 


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