+ Reply to Thread
Results 1 to 3 of 3

Arranging graphical objects on sheet

  1. #1
    quartz
    Guest

    Arranging graphical objects on sheet

    I have a program that copies several images and pastes them sequentially into
    a single Excel sheet.

    Does anyone have a function that can position each successive image
    immediately below, but not overlapping the previously copied image? If you
    could supply example code it would be most appreciated.



  2. #2
    Tom Ogilvy
    Guest

    Re: Arranging graphical objects on sheet

    assign the top attribute of the new image to the sum of the top and height
    attributes of the previous image.

    --
    Regards,
    Tom Ogivly

    "quartz" <[email protected]> wrote in message
    news:[email protected]...
    > I have a program that copies several images and pastes them sequentially

    into
    > a single Excel sheet.
    >
    > Does anyone have a function that can position each successive image
    > immediately below, but not overlapping the previously copied image? If you
    > could supply example code it would be most appreciated.
    >
    >




  3. #3
    Sharad Naik
    Guest

    Re: Arranging graphical objects on sheet

    Example copying pix from Sheet2 to Sheet1:

    Dim shp As Shape, shpSh1 As Shape
    Dim i
    Sheet1.Select
    Sheet1.Range("A1").Select
    For Each shp In Sheet2.Shapes
    shp.CopyPicture
    Sheet1.Paste
    i = Sheet1.Shapes.Count
    Set shpSh1 = Sheet1.Shapes(i)
    If i > 1 Then
    shpSh1.Left = Sheet1.Shapes(i - 1).Left
    shpSh1.Top = Sheet1.Shapes(i - 1).Top _
    + Sheet1.Shapes(i - 1).Height
    'If you want to match th height and width too
    ' then keep below 2 lines, else delete them
    shpSh1.Height = Sheet1.Shapes(i - 1).Height
    shpSh1Width= Sheet1.Shapes(i - 1).Width
    End If
    Next

    Sharad

    "quartz" <[email protected]> wrote in message
    news:[email protected]...
    >I have a program that copies several images and pastes them sequentially
    >into
    > a single Excel sheet.
    >
    > Does anyone have a function that can position each successive image
    > immediately below, but not overlapping the previously copied image? If you
    > could supply example code it would be most appreciated.
    >
    >




+ 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