Adjust Chart Size

  • Thread starter Thread starter dannypctang
  • Start date Start date
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.
 
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
 
Back
Top