+ Reply to Thread
Results 1 to 3 of 3

Set position into a worksheet using vba

  1. #1
    Ricardo Mercader
    Guest

    Set position into a worksheet using vba

    I created a chart as an object in a worksheet, but can't set the position
    inside it.
    Any help?

    Thanks in advanced



  2. #2
    Jon Peltier
    Guest

    Re: Set position into a worksheet using vba

    How did you create the chart object? This allows you to define the position exactly:

    Worksheets("Sheet1").ChartObjects.Add(100,150,300,225)

    where the numbers are left, top, width, and height of the chart object in points
    with respect to the top left of the sheet.

    For an existing chart, again you should adjust the chart object, which is the parent
    object of the chart:

    With ActiveChart.Parent
    .Left = 100
    .Top = 150
    .Width = 300
    .Height = 225
    End With

    - Jon
    -------
    Jon Peltier, Microsoft Excel MVP
    Peltier Technical Services
    Tutorials and Custom Solutions
    http://PeltierTech.com/
    _______

    Ricardo Mercader wrote:

    > I created a chart as an object in a worksheet, but can't set the position
    > inside it.
    > Any help?
    >
    > Thanks in advanced
    >
    >



  3. #3
    Ricardo Mercader
    Guest

    Re: Set position into a worksheet using vba

    Thanks, it works fine.

    "Jon Peltier" <[email protected]> escribió en el mensaje
    news:[email protected]...
    > How did you create the chart object? This allows you to define the
    > position exactly:
    >
    > Worksheets("Sheet1").ChartObjects.Add(100,150,300,225)
    >
    > where the numbers are left, top, width, and height of the chart object in
    > points with respect to the top left of the sheet.
    >
    > For an existing chart, again you should adjust the chart object, which is
    > the parent object of the chart:
    >
    > With ActiveChart.Parent
    > .Left = 100
    > .Top = 150
    > .Width = 300
    > .Height = 225
    > End With
    >
    > - Jon
    > -------
    > Jon Peltier, Microsoft Excel MVP
    > Peltier Technical Services
    > Tutorials and Custom Solutions
    > http://PeltierTech.com/
    > _______
    >
    > Ricardo Mercader wrote:
    >
    >> I created a chart as an object in a worksheet, but can't set the position
    >> inside it.
    >> Any help?
    >>
    >> Thanks in advanced

    >




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1