Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default Positioning of Chart Objects on an Excel Sheet

Hi Chris,

Dim chtObj as ChartObject
dim cht as Chart

Set chtObj = ActiveSheet.ChartObjects.Add(L, T, W, H)
Set cht = chtObj.Chart

and go on to add whatever to 'cht'

The coordinates might be those of a range to line up with cells, or whatever
position and size you require.

Regards,
Peter T


"Chris Gorham" wrote in message
...
Hi,

I've written a graph plotting program that outputs the charts either as

new
sheets in the workbook or alternatively as objects placed in order on a

new
worksheet.

I'm having difficulty persuading the code to place the charts in a neat
order on the sheet...

Is it possible to link the chart object to a cell range rather than

specify
coordinates...??

Thanks...Chris




  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default Positioning of Chart Objects on an Excel Sheet

eg -

Sub test()
Dim j As Long, k As Long
Dim chtObj As ChartObject
Dim cht As Chart
Dim sr As Series

For k = 2 To 2 + (5 * 3) Step 5

For j = 2 To 2 + (10 * 4) Step 10
Set rng = Range(Cells(j, k), Cells(j + 7, k + 3))

With rng

Set chtObj = ActiveSheet.ChartObjects.Add(.Left, .Top, .Width, .Height)
Set cht = chtObj.Chart
Set sr = cht.SeriesCollection.NewSeries
sr.Values = "{1,2,3}"

End With

Next
Next

End Sub

Peter T


"Peter T" <peter_t@discussions wrote in message
...
Hi Chris,

Dim chtObj as ChartObject
dim cht as Chart

Set chtObj = ActiveSheet.ChartObjects.Add(L, T, W, H)
Set cht = chtObj.Chart

and go on to add whatever to 'cht'

The coordinates might be those of a range to line up with cells, or

whatever
position and size you require.

Regards,
Peter T


"Chris Gorham" wrote in message
...
Hi,

I've written a graph plotting program that outputs the charts either as

new
sheets in the workbook or alternatively as objects placed in order on a

new
worksheet.

I'm having difficulty persuading the code to place the charts in a neat
order on the sheet...

Is it possible to link the chart object to a cell range rather than

specify
coordinates...??

Thanks...Chris






Reply
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
Positioning a sheet Roger Bedford Excel Programming 4 November 13th 06 01:53 AM
Positioning text Boxes on an excel chart cricketBuff Excel Programming 0 March 15th 06 07:04 PM
Positioning a chart on the worksheet gvm Excel Programming 3 November 18th 05 01:10 AM
excel chart size using inside positioning Travis Charts and Charting in Excel 2 February 15th 05 04:10 AM
Unable to remove Sheet objects in the Microsoft Excel Objects Adrian[_7_] Excel Programming 1 August 26th 04 10:49 PM


All times are GMT +1. The time now is 11:26 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"