+ Reply to Thread
Results 1 to 4 of 4

VBA Code/Macro for Sizing A Picture to a Range of Cells(reply to old thread)

  1. #1
    Forum Contributor
    Join Date
    08-22-2009
    Location
    Manitoba
    MS-Off Ver
    Office 2010
    Posts
    524

    VBA Code/Macro for Sizing A Picture to a Range of Cells(reply to old thread)

    Rules are rules. I found an old thread with code that works 99%! One question, when the window pops up to select a picture from folders and you decide to cancel, the macro throws up and error at "ActiveSheet.Pictures.Insert(Picture1).Select". I am drawing a blank tonight as to how to prevent that from happening. Need an out, if you could help or someone out there? Thanks!

    Here is the link to the old thread as per rules. http://www.excelforum.com/excel-prog...-of-cells.html

  2. #2
    Forum Expert MickG's Avatar
    Join Date
    11-23-2007
    Location
    Banbury,Oxfordshire
    Posts
    2,650

    Re: VBA Code/Macro for Sizing A Picture to a Range of Cells(reply to old thread)

    Change Variable "Picture1" to Variant Type, and add line below, And an "End if" at bottom of code

    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    08-22-2009
    Location
    Manitoba
    MS-Off Ver
    Office 2010
    Posts
    524

    Re: VBA Code/Macro for Sizing A Picture to a Range of Cells(reply to old thread)

    Thanks MickG!! Works 100% now, awesome!

  4. #4
    Forum Contributor
    Join Date
    08-22-2009
    Location
    Manitoba
    MS-Off Ver
    Office 2010
    Posts
    524

    Re: VBA Code/Macro for Sizing A Picture to a Range of Cells(reply to old thread)

    Now I have a new problem related to the original code. The "Application.GetOpenFilename("Picture,*.JPG,Picture,*.JPEG,Picture,*.GIF,Picture,*.BMP")" line worked great until I went and added another format, "Picture,*.png"! Now when the window opens, all I see in the Picture drop box in lower right corner is "Picture" repeated four times, instead of .jpg, .jpeg, .GIF, .BMP. No matter what I do now, it just shows Picture. Is there something I need to clear out of memory or what, how do I fix this? Thanks again to anyone that can help.

+ 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. [SOLVED] VBA Code/Macro for Sizing A Picture to a Range of Cells
    By Swierchris in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-21-2015, 12:40 AM
  2. Inserting Picture into Comment and re-sizing to fit chosen picture
    By ericmartin.hr in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-17-2014, 01:53 AM
  3. [SOLVED] sizing picture same picture in multiple sheets macro clean up
    By martinez77 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-12-2013, 10:14 PM
  4. Complaint about Reply to Thread Button
    By Jiptastic in forum Suggestions for Improvement
    Replies: 7
    Last Post: 02-25-2013, 01:53 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