Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,560
Default Activechart.parent.left

Hi Group,

I am trying to place a chart in a specific location on the worksheet. This
code locates it to column N, but does not place it on Row 3, which I expected
to happen:

ActiveChart.Parent.Left = Range("N3").Left

I would also like to anchor it in the bottom right, basically locate and
size it. N3 to AB35.

Thanks for your help.

David
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 298
Default Activechart.parent.left

David,

Left is just left, not top left.

Dim rng as range
Set rng = Sheet1.Range("N3:AB35")

with ActiveChart.Parent
.Top = rng.Cells(1).Top
.Left = rng.Cells(1).Left
.width= rng.Width
.Height=rng.Height
end with


Tim

"David" wrote in message
...
Hi Group,

I am trying to place a chart in a specific location on the worksheet. This
code locates it to column N, but does not place it on Row 3, which I
expected
to happen:

ActiveChart.Parent.Left = Range("N3").Left

I would also like to anchor it in the bottom right, basically locate and
size it. N3 to AB35.

Thanks for your help.

David



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,560
Default Activechart.parent.left

Hi Tim,

Thank you. I tried to look up help, since this is not quite doing what I
expected, but help was not very helpful. It is difficult to see what the
measures are, but I think it is in pixels? Some of the results:
?rng.Cells(1).Top = 25.5
?rng.Cells(1).Left = 202.5
?rng.Width = 780
?rng.Height = 420.75

The left-top ended up in E3, so I guess I need to figure out the pixels to
get it to N3. Again, thnk you for your help.

David




"Tim Williams" wrote:

David,

Left is just left, not top left.

Dim rng as range
Set rng = Sheet1.Range("N3:AB35")

with ActiveChart.Parent
.Top = rng.Cells(1).Top
.Left = rng.Cells(1).Left
.width= rng.Width
.Height=rng.Height
end with


Tim

"David" wrote in message
...
Hi Group,

I am trying to place a chart in a specific location on the worksheet. This
code locates it to column N, but does not place it on Row 3, which I
expected
to happen:

ActiveChart.Parent.Left = Range("N3").Left

I would also like to anchor it in the bottom right, basically locate and
size it. N3 to AB35.

Thanks for your help.

David




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 298
Default Activechart.parent.left

David,

All I can say is it works for me. Is your chart located on Sheet1 ?
That was just an example, so you may need to modify to suit your situation

Here's a version which doesn't have a defined sheet reference - it just
looks at the sheet hosting the chart.

Sub Tester()
Dim rng As Range

With ActiveChart.Parent
Set rng = .Parent.Range("N3:AB35")
.Top = rng.Top
.Left = rng.Left
.Width = rng.Width
.Height = rng.Height
End With
End Sub

Tim


"David" wrote in message
...
Hi Tim,

Thank you. I tried to look up help, since this is not quite doing what I
expected, but help was not very helpful. It is difficult to see what the
measures are, but I think it is in pixels? Some of the results:
?rng.Cells(1).Top = 25.5
?rng.Cells(1).Left = 202.5
?rng.Width = 780
?rng.Height = 420.75

The left-top ended up in E3, so I guess I need to figure out the pixels to
get it to N3. Again, thnk you for your help.

David




"Tim Williams" wrote:

David,

Left is just left, not top left.

Dim rng as range
Set rng = Sheet1.Range("N3:AB35")

with ActiveChart.Parent
.Top = rng.Cells(1).Top
.Left = rng.Cells(1).Left
.width= rng.Width
.Height=rng.Height
end with


Tim

"David" wrote in message
...
Hi Group,

I am trying to place a chart in a specific location on the worksheet.
This
code locates it to column N, but does not place it on Row 3, which I
expected
to happen:

ActiveChart.Parent.Left = Range("N3").Left

I would also like to anchor it in the bottom right, basically locate
and
size it. N3 to AB35.

Thanks for your help.

David






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
ActiveChart.Location help Dave Excel Discussion (Misc queries) 1 November 16th 07 07:38 PM
ActiveChart.ADD Fails Sean McPoland[_6_] Excel Programming 3 September 24th 04 04:19 AM
Activechart.SetSourceData Source??? Bob R Excel Programming 2 July 30th 04 03:39 PM
Activechart.SetSourceMethod problem grinning_crow Excel Programming 2 March 1st 04 10:07 PM
Argument List Of ActiveChart.Location And ActiveChart.ChartType Mo[_3_] Excel Programming 2 September 1st 03 11:12 PM


All times are GMT +1. The time now is 09:44 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"