ShapeRange question
Prep for a pre-employment Excel test with Job Test Prep
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 3 of 3

Thread: ShapeRange question

  1. #1
    New Member
    Join Date
    Mar 2002
    Posts
    27
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

     
    Is there anyway to specify the left and top distances for a ShapeRange object using vba?

    For instance, I can specify the following using a recorded macro:

    Selection.ShapeRange.Height = 45.07
    Selection.ShapeRange.Width = 413.01
    Selection.ShapeRange.IncrementLeft -8.49
    Selection.ShapeRange.IncrementTop -0.31


    But can you specify the actual left and top values (not just increment values)? This is for a object located on a chart. The full code I am using to relocate the object is as such:

    ActiveSheet.ChartObjects("Chart 11").Activate
    ActiveChart.ChartArea.Select
    ActiveChart.Shapes("Group 23").Select
    Selection.ShapeRange.LockAspectRatio = msoFalse
    Selection.ShapeRange.Height = 45.07
    Selection.ShapeRange.Width = 413.01
    Selection.ShapeRange.IncrementLeft -8.49
    Selection.ShapeRange.IncrementTop -0.31


    Thanks,
    Corey D.


  2. #2
    New Member
    Join Date
    Feb 2002
    Posts
    10
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    I think there is a .Top and a .Left property that you can use for shaperanges

  3. #3
    Rest in Peace
    Join Date
    Feb 2002
    Posts
    1,582
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

      
    Hi Corey

    Just use

    With ActiveSheet.ChartObjects("Chart 11")
    .Left = 0
    .Top = 0
    End With


User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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

 

 
DMCA.com