Adjust Chart Size

D

dannypctang

Hi, I would like to create multiple charts by VBA. However, the chart
size were difference in different resolution's computers. May I know
how to make all charts have Width=10cells x Height = 15cells under
different resolution's computers? Thanks.
 
T

Tim Williams

You can set the chartobject's Width and Height to the Width and Height of a
10x15 range on the worksheet.
However, this assumes all users have the same cell "sizes"

'****************
dim rng as range
set rng=range(activesheet.cells(1,1), activesheet.cells(15,10))

with oChart
.width = rng.width
.height = rng.height
end with
'*****************

Adjust to suit.

Tim
 

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

Top