Results 1 to 11 of 11
  1. #1
    Star Lounger
    Join Date
    Jul 2006
    Posts
    71
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Stretch-Squeeze Button (2003)

    This may have come up before . . .
    I have a spreadsheet with buttons. Since most of them are tucked in the first part of Column A, to the left of the header rows, those don't seem to change size and shape much as the sheet is used. Two buttons in rows just below the header rows, though, are images and tend, over time, to be stretched or squeezed out of shape. I set the image instructions to keep the ratio of height and width Fixed, but I might as well not have bothered.

    Luckily the images are sketches of cats (the program's name is CATS) and a real cat has enough stretch and squeeze that the cat buttons don't look hopelessly messy when the height increases or the width does, but I'd like them to stay the way I put them. All rows below the header are sorted -- often -- or deleted or added to, which I'm sure aggrevates the problem.

    Any ideas?

    axsc

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Stretch-Squeeze Button (2003)

    Right-click a button or picture.
    Select Format Picture or Format Control from the popup menu.
    Activate the Properties tab.
    Select "Don't move or size with cells".
    Click OK.

  3. #3
    Star Lounger
    Join Date
    Jul 2006
    Posts
    71
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Stretch-Squeeze Button (2003)

    This happens even WITH those properties set. I know it "shouldn't."

    Thanks anyway,

    axsc

  4. #4
    Star Lounger
    Join Date
    Jul 2006
    Posts
    71
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Stretch-Squeeze Button (2003)

    Is there was a way Excel could identify the image, and resize it, as part of a macro running?

  5. #5
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Stretch-Squeeze Button (2003)

    By "button", do you mean a command button from the Control Toolbox toolbar?

  6. #6
    Star Lounger
    Join Date
    Jul 2006
    Posts
    71
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Stretch-Squeeze Button (2003)

    Four of them are simple colored rectangles created from the Drawing toolbar. Two started life as imported .GIF's.

  7. #7
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Stretch-Squeeze Button (2003)

    I cannot reproduce the problem, but I think you'll have to store the original dimensions of each of them in global variables or in cells on a hidden sheet, and use these to restore the dimensions if necessary. I don't see anything in VBA that corresponds to the Reset button for pictures...

  8. #8
    Star Lounger
    Join Date
    Jul 2006
    Posts
    71
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Stretch-Squeeze Button (2003)

    If I understand correctly -- and at this hour the brain is probably snapping synapses -- the original dimensions of the GIFs and the drawn rectangles would be stored and then the objects would be resized when needed.

    How do I identify the objects so that Excel can modify them? The imported GIFs had names, of course, but the simple colored rectangles probably don't. Some variant of "Go to"?

    Thanks, as always,

    Ann

  9. #9
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Stretch-Squeeze Button (2003)

    You can find the name of an object as follows:

    - Click on it to select it.
    - Look at the address box on the left hand side of the formula bar.
    - If you see for example Picture 2, you can refer to this object in code as follows:

    ActiveSheet.Shapes("Picture 2")

  10. #10
    Star Lounger
    Join Date
    Jul 2006
    Posts
    71
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Stretch-Squeeze Button (2003)

    There they were -- the drawing shapes were "Rectangle ###" and the 'cat' buttons were "Picture ###" . Now to research how to modify their shapes . . . .

    Thank you again!

  11. #11
    Star Lounger
    Join Date
    Jul 2006
    Posts
    71
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Stretch-Squeeze Button (2003)

    For what it's worth, I finally concluded that the smoothest way to deal with stretching and squeezing was to remove all Lock Ratio options and specify/reset the picture size every time the file loaded. Seems to be working satisfactorily.

Posting Permissions

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