+ Reply to Thread
Results 1 to 4 of 4

Positioning all pictures

  1. #1
    gejmond
    Guest

    Positioning all pictures

    Hi

    Can anyone please advise on how to change the positioning properties
    for 'all' the pictures on my spreadsheet?

    In order to sort properly without the results distorting the pictures,
    I need to set their positioning to "Move but don't size with cells".
    Doing this individually would mean selecting format picture then going
    on to the properties tab. However I can't seem to be able to do this
    for multiple pictures, and I have lots.

    I suspect the answer is in VBA (whatever that is!) I have used VBA
    before to set up a macro for something but just followed exactly the
    very good instructions from another poster, so I'm completely novice at
    it really.

    Any help would be greatly appreciated!

    gejmond


  2. #2
    Dave Peterson
    Guest

    Re: Positioning all pictures

    I got this when I recorded a macro (to fix one picture):

    Option Explicit
    Sub Macro1()
    ActiveSheet.Shapes("Picture 1").Select
    With Selection
    .Placement = xlMove
    .PrintObject = True
    End With
    End Sub


    Getting rid of the .select and cycling through all the pictures, I could use
    this:

    Option Explicit
    Sub testme()
    Dim myPict As Picture
    For Each myPict In ActiveSheet.Pictures
    myPict.Placement = xlMove
    Next myPict
    End Sub

    I also got rid of the .printobject stuff.

    gejmond wrote:
    >
    > Hi
    >
    > Can anyone please advise on how to change the positioning properties
    > for 'all' the pictures on my spreadsheet?
    >
    > In order to sort properly without the results distorting the pictures,
    > I need to set their positioning to "Move but don't size with cells".
    > Doing this individually would mean selecting format picture then going
    > on to the properties tab. However I can't seem to be able to do this
    > for multiple pictures, and I have lots.
    >
    > I suspect the answer is in VBA (whatever that is!) I have used VBA
    > before to set up a macro for something but just followed exactly the
    > very good instructions from another poster, so I'm completely novice at
    > it really.
    >
    > Any help would be greatly appreciated!
    >
    > gejmond


    --

    Dave Peterson

  3. #3
    gejmond
    Guest

    Re: Positioning all pictures

    Thanks v much Dave for replying

    I copied and pasted:
    > Option Explicit
    > Sub testme()
    > Dim myPict As Picture
    > For Each myPict In ActiveSheet.Pictures
    > myPict.Placement = xlMove
    > Next myPict
    > End Sub


    as a new macro. Not sure this is what you meant for me to do but it
    doesn't seem to do anything. I will keep on playing with it....


  4. #4
    Dave Peterson
    Guest

    Re: Positioning all pictures

    After you run the macro, right click on one of the pictures and see how the move
    and size is set.

    gejmond wrote:
    >
    > Thanks v much Dave for replying
    >
    > I copied and pasted:
    > > Option Explicit
    > > Sub testme()
    > > Dim myPict As Picture
    > > For Each myPict In ActiveSheet.Pictures
    > > myPict.Placement = xlMove
    > > Next myPict
    > > End Sub

    >
    > as a new macro. Not sure this is what you meant for me to do but it
    > doesn't seem to do anything. I will keep on playing with it....


    --

    Dave Peterson

+ 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