+ Reply to Thread
Results 1 to 8 of 8

Removing Picture

  1. #1
    Forum Contributor
    Join Date
    02-26-2009
    Location
    Auckland, New Zealand
    MS-Off Ver
    Excel 2010
    Posts
    286

    Removing Picture

    I have used code to insert a picture (Bracket.jpg) into a cell range (B38:I51).
    The picture file name varies but the insert range remains the same. In one case Excel notes the inserted picture as "Picture17" and another case as "Picture5"!
    What would be the code to remove the inserted picture?
    Thanks Sandy

  2. #2
    Valued Forum Contributor
    Join Date
    07-10-2017
    Location
    Toronto, Ontario
    MS-Off Ver
    Excel 2013
    Posts
    430

    Re: Removing Picture

    If you have no other images on the sheet that you want to keep you could use
    Please Login or Register  to view this content.

  3. #3
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Removing Picture

    You could also look for the picture whose top and left were the same as the insert range top and left
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  4. #4
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: Removing Picture

    You might also give the picture a specific name when you insert it, which would make deleting it a trivial task.
    Don
    Please remember to mark your thread 'Solved' when appropriate.

  5. #5
    Forum Expert
    Join Date
    04-01-2013
    Location
    East Auckland
    MS-Off Ver
    Excel 365
    Posts
    1,343

    Re: Removing Picture

    I suggest you go with xlnitwit's idea and name it properly on inserting. Fix problems at the root rather than at the other end !
    Show us the code if you have any concerns with doing that.
    If you want something done right... find a forum and ask an online expert.

    Time flies like an arrow. Fruit flies like a banana.

  6. #6
    Forum Contributor
    Join Date
    02-26-2009
    Location
    Auckland, New Zealand
    MS-Off Ver
    Excel 2010
    Posts
    286

    Re: Removing Picture

    Thanks Guys.

    The picture is selected from a combobox (cmbBrack) in a userform, and on exit the following code runs:

    Please Login or Register  to view this content.
    Then this code adds the picture to range B38:I51:
    Please Login or Register  to view this content.
    Unsure how to proceed now, sample code would help.

  7. #7
    Forum Expert
    Join Date
    04-01-2013
    Location
    East Auckland
    MS-Off Ver
    Excel 365
    Posts
    1,343

    Re: Removing Picture

    I presume in the "with p" section just add

    Please Login or Register  to view this content.
    ie
    Please Login or Register  to view this content.
    then obviously refer to it by name in any future code.

  8. #8
    Forum Contributor
    Join Date
    02-26-2009
    Location
    Auckland, New Zealand
    MS-Off Ver
    Excel 2010
    Posts
    286

    Re: Removing Picture

    Thanks scottiex that worked a treat.
    Cheers Sandy

+ 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. Replies: 6
    Last Post: 06-20-2016, 10:02 PM
  2. [SOLVED] Open File, Load Picture and on reopen (Initialize) the picture loads.
    By jquintana83 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-20-2014, 12:05 PM
  3. Click on picture and run macro to replace existing picture with selected picture file
    By houseflipsheet in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-14-2014, 12:02 AM
  4. Removing All Entries if Duplicate Value (picture)
    By cmf0106 in forum Excel General
    Replies: 2
    Last Post: 12-02-2013, 12:46 AM
  5. How to compress a picture by removing cropped edges
    By luv2glyd in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-15-2012, 07:58 PM
  6. [SOLVED] macro: insert picture based on workbook location, not picture root path.
    By NicksDad in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-03-2012, 07:47 AM
  7. Insertion of picture by xls formula/ naming the picture with multiple selection crite
    By luckiest man in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-18-2011, 12:11 AM

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