Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Ricardo Mercader
 
Posts: n/a
Default Set position into a worksheet using vba

I created a chart as an object in a worksheet, but can't set the position
inside it.
Any help?

Thanks in advanced


  #2   Report Post  
Jon Peltier
 
Posts: n/a
Default Set position into a worksheet using vba

How did you create the chart object? This allows you to define the position exactly:

Worksheets("Sheet1").ChartObjects.Add(100,150,300, 225)

where the numbers are left, top, width, and height of the chart object in points
with respect to the top left of the sheet.

For an existing chart, again you should adjust the chart object, which is the parent
object of the chart:

With ActiveChart.Parent
.Left = 100
.Top = 150
.Width = 300
.Height = 225
End With

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

Ricardo Mercader wrote:

I created a chart as an object in a worksheet, but can't set the position
inside it.
Any help?

Thanks in advanced



  #3   Report Post  
Ricardo Mercader
 
Posts: n/a
Default Set position into a worksheet using vba

Thanks, it works fine.

"Jon Peltier" escribió en el mensaje
...
How did you create the chart object? This allows you to define the
position exactly:

Worksheets("Sheet1").ChartObjects.Add(100,150,300, 225)

where the numbers are left, top, width, and height of the chart object in
points with respect to the top left of the sheet.

For an existing chart, again you should adjust the chart object, which is
the parent object of the chart:

With ActiveChart.Parent
.Left = 100
.Top = 150
.Width = 300
.Height = 225
End With

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

Ricardo Mercader wrote:

I created a chart as an object in a worksheet, but can't set the position
inside it.
Any help?

Thanks in advanced




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
VBA code to Add data to exsiting worksheet jonesaa05 Excel Discussion (Misc queries) 7 October 14th 05 01:20 PM
advanced: synchronizing data value across two worksheet drop boxes mdhokie Excel Worksheet Functions 1 October 6th 05 08:46 PM
Inserting Filtered RC cell information into other worksheets Dennis Excel Discussion (Misc queries) 10 July 30th 05 01:54 AM
Worksheet Function - Find? DAA Excel Worksheet Functions 2 February 24th 05 04:15 PM
copyright and worksheet protection dow Excel Discussion (Misc queries) 2 January 3rd 05 03:07 PM


All times are GMT +1. The time now is 11:15 PM.

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"