Consulting

Results 1 to 2 of 2

Thread: Set Chart Height and Width to Match Page Dimensions

  1. #1

    Set Chart Height and Width to Match Page Dimensions

    I am using the following code to set a chart's height and width:

    [vba]
    ActiveSheet.ChartObjects (1)
    With ActiveChart.Parent
    .Height = 524.2
    .Width = 623
    .Top = topStartLocation
    .Left = leftStartLocation
    End With
    [/vba]

    That works great on my machine but it looks bad on other machines. Is there any way to change:

    .Height = 524.2

    to

    .Height = pageHeight?

  2. #2
    VBAX Tutor
    Joined
    Sep 2007
    Posts
    265
    Location
    untested

    [VBA].Height = (ThisWorkbook.Sheets("1").UsedRange.Rows.Count + 2) * 7[/VBA]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •