Chart Placement incorrect in macro due to differant screen resolutions

  • Thread starter Thread starter lukegunther
  • Start date Start date
L

lukegunther

Hi Team,

Hoping you can help me out with this one which I immagine is pretty
common.

I have created a a macro which in turn creates a series of charts to
display. While on my machine they appear perfectly placed, when other
users access the macro the charts will be a differant dimension and
not in the right place.

Of course this is very frustrating for other users, no so much myself
however :)

I was hoping there was a way to define possibly by Cell Referance
where the charts appear?

All help will be greatly appreciated.

Thanks,

Luke
 
Charts are placed by there .left and .top location. A cell also has a .left
and .top property.

If you had the chart name you could do something like this

for each chrt in activesheet.shapes
chrt.top = Range("B5").top
chrt.left = Range("B5").right
next chrt
 
One way:

With ActiveSheet
.ChartObjects(1).Top = Range("F10").Top
.ChartObjects(1).Left = Range("F10").Left
End With
 
Similarly,

With ActiveSheet
.ChartObjects(1).Width = Range("F10:M30").Width
.ChartObjects(1).Height = Range("F10:M30").Height
End With

- Jon
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top