+ Reply to Thread
Results 1 to 12 of 12

automatically fit an image into merged cells for full width of merged cells

  1. #1
    Registered User
    Join Date
    06-02-2014
    Posts
    88

    automatically fit an image into merged cells for full width of merged cells

    Please Login or Register  to view this content.
    Do you know how should I modify this code for uploaded picture to be scaled with locked aspect ratio for full width of merged cells?

  2. #2
    Forum Guru karedog's Avatar
    Join Date
    10-03-2014
    Location
    Indonesia
    MS-Off Ver
    2003
    Posts
    2,971

    Re: automatically fit an image into merged cells for full width of merged cells

    Hi,

    Delete these lines :

    Please Login or Register  to view this content.
    Regards
    1. I care dog
    2. I am a loop maniac
    3. Forum rules link : Click here
    3.33. Don't forget to mark the thread as solved, this is important

  3. #3
    Registered User
    Join Date
    06-02-2014
    Posts
    88

    Re: automatically fit an image into merged cells for full width of merged cells

    Thanks Karedog
    Actually the code is simpler, but picture is not scaled to full width of merged cells.
    I wonder about center and middle allign to full width for the graph. Do you perhaps know how to modify code?

    Please Login or Register  to view this content.

  4. #4
    Forum Guru karedog's Avatar
    Join Date
    10-03-2014
    Location
    Indonesia
    MS-Off Ver
    2003
    Posts
    2,971

    Re: automatically fit an image into merged cells for full width of merged cells

    Is this a picture or a graph ? You can't use your macro above for graphs.
    Please upload a sample file to clarify it.

  5. #5
    Registered User
    Join Date
    06-02-2014
    Posts
    88

    Re: automatically fit an image into merged cells for full width of merged cells

    So here you can find button Upload Picture. When clicked, you run two macros:
    - Insert Picture, and
    - Position and Scale Picture
    20141117 generator procesów.xlsm

  6. #6
    Forum Guru karedog's Avatar
    Join Date
    10-03-2014
    Location
    Indonesia
    MS-Off Ver
    2003
    Posts
    2,971

    Re: automatically fit an image into merged cells for full width of merged cells

    I find that the code at post #3 already fulfill your wish, that is "full width of merged cells ", of course since this code is keeping the aspect ratio (the pic will not distort), the height of pic will vary, either smaller or bigger than cell height. Here is the sample pic : Keep aspect ratio

    But if you want the whole cell is covered with the pic (this mean sacrifice the "keep aspect ratio"), then this is the code :

    Please Login or Register  to view this content.
    The sample pic : Full - distorted

  7. #7
    Registered User
    Join Date
    06-02-2014
    Posts
    88

    Re: automatically fit an image into merged cells for full width of merged cells

    Thank you,
    It works great for height. However, is it possible to fit picture in frames of merged cells with aspect ratio excluded?
    wizualizacja.jpg

  8. #8
    Forum Guru karedog's Avatar
    Join Date
    10-03-2014
    Location
    Indonesia
    MS-Off Ver
    2003
    Posts
    2,971

    Re: automatically fit an image into merged cells for full width of merged cells

    Your picture is not showed up, I get an error : "The image http://www.excelforum.com/attachment...zualizacja.jpg cannot be displayed because it contains errors."

    BTW, the code at post #6 already "exclude aspect ratio".

  9. #9
    Registered User
    Join Date
    06-02-2014
    Posts
    88

    Re: automatically fit an image into merged cells for full width of merged cells

    What I mean is auto-fit to right of merged cells - http://www.opendrive.com/files/OF81O...zualizacja.jpg

  10. #10
    Forum Guru karedog's Avatar
    Join Date
    10-03-2014
    Location
    Indonesia
    MS-Off Ver
    2003
    Posts
    2,971

    Re: automatically fit an image into merged cells for full width of merged cells

    I just realize that for Excel 2007++ the aspect ratio is default to locked (previously I tried to run using Excel 2003, and its default is not to locked).
    Here is the code to disable aspect ratio :

    Please Login or Register  to view this content.

  11. #11
    Registered User
    Join Date
    06-02-2014
    Posts
    88

    Re: automatically fit an image into merged cells for full width of merged cells

    Works perfect!
    Thank you for your help and time.

    Regards,
    Marcin Krawczynski

  12. #12
    Forum Guru karedog's Avatar
    Join Date
    10-03-2014
    Location
    Indonesia
    MS-Off Ver
    2003
    Posts
    2,971

    Re: automatically fit an image into merged cells for full width of merged cells

    You are welcome Marcin, and please mark this thread as SOLVED, thank you.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. automatically fit an image into merged cells
    By dave in forum Excel General
    Replies: 3
    Last Post: 11-18-2014, 06:26 AM
  2. [SOLVED] Merged Cells and Column Width
    By schmidt1962 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 11-24-2013, 09:19 PM
  3. Replies: 1
    Last Post: 06-28-2012, 11:53 AM
  4. width of Merged cells within un merged cells
    By Darin Kramer in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-14-2005, 06:05 AM
  5. [SOLVED] Merged cells width
    By davegb in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-01-2005, 05:05 PM

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