+ Reply to Thread
Results 1 to 22 of 22

Insert picture on blank colored cells and remove all picture

  1. #1
    Forum Contributor
    Join Date
    12-14-2016
    Location
    UAE
    MS-Off Ver
    MS OFFICE 2016 & 2019
    Posts
    154

    Insert picture on blank colored cells and remove all picture

    Hi Experts,

    i have a worksheet that i need to insert picture which is colored yellow on blank cells by selecting button Insert picture from the range A1:AB1650 and if i need to remove all the picture by selecting button remove pictures.

    The picture should be auto fit size according to the blank cell sizes.

    Please see the attached file.
    Attached Images Attached Images
    Attached Files Attached Files

  2. #2
    Forum Contributor
    Join Date
    12-14-2016
    Location
    UAE
    MS-Off Ver
    MS OFFICE 2016 & 2019
    Posts
    154

    Re: Insert picture on blank colored cells and remove all picture

    Hello Experts,

    Please anybody help to solve this thread.

  3. #3
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,236

    Re: Insert picture on blank colored cells and remove all picture

    Hi sathishsusa

    Save your image in same path as workbook...
    Please Login or Register  to view this content.
    Good Luck
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the star to left of post [Add Reputation]
    Also....add a comment if you like!!!!
    And remember...Mark Thread as Solved.
    Excel Forum Rocks!!!

  4. #4
    Forum Contributor
    Join Date
    12-14-2016
    Location
    UAE
    MS-Off Ver
    MS OFFICE 2016 & 2019
    Posts
    154

    Re: Insert picture on blank colored cells and remove all picture

    Hi Sintex,

    Thanks you so much for your code. i tested the code i got the error on the line which is - "Set pic = ActiveSheet.Pictures.Insert(picName)" i place the picture in same folder path only even though picture not inserting.
    Attached Images Attached Images

  5. #5
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,236

    Re: Insert picture on blank colored cells and remove all picture

    oops, dunno what happened there....pls change
    Please Login or Register  to view this content.
    to
    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    06-02-2018
    Location
    Italy
    MS-Off Ver
    2013-2019
    Posts
    31

    Re: Insert picture on blank colored cells and remove all picture

    Insert method need the complete path of image.

    Replace row with:
    Please Login or Register  to view this content.

  7. #7
    Forum Contributor
    Join Date
    12-14-2016
    Location
    UAE
    MS-Off Ver
    MS OFFICE 2016 & 2019
    Posts
    154

    Re: Insert picture on blank colored cells and remove all picture

    Awesome its works perfectly thanks a lot.

    one small request sir the yellow color blank cells finds only the pictures will insert right sir, if i change to other colors frequently on blank cells also i code to insert pictures so what code i need to use on it.

  8. #8
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,236

    Re: Insert picture on blank colored cells and remove all picture

    Are you wanting to insert pics in all blank cells or only cells with colors

  9. #9
    Forum Contributor
    Join Date
    12-14-2016
    Location
    UAE
    MS-Off Ver
    MS OFFICE 2016 & 2019
    Posts
    154

    Re: Insert picture on blank colored cells and remove all picture

    yes sir all blank cells only in range A1:AB1650. color its not a consider to insert the pictures.

  10. #10
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,236

    Re: Insert picture on blank colored cells and remove all picture

    Please Login or Register  to view this content.
    TO
    Please Login or Register  to view this content.

  11. #11
    Forum Contributor
    Join Date
    12-14-2016
    Location
    UAE
    MS-Off Ver
    MS OFFICE 2016 & 2019
    Posts
    154

    Re: Insert picture on blank colored cells and remove all picture

    sir the picture was inserting but there is error showing " Type Mismatch Error"
    Last edited by Anisusa; 06-04-2018 at 07:00 AM.

  12. #12
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,236

    Re: Insert picture on blank colored cells and remove all picture

    You have a formula error in I257
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    instead of
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  13. #13
    Forum Contributor
    Join Date
    12-14-2016
    Location
    UAE
    MS-Off Ver
    MS OFFICE 2016 & 2019
    Posts
    154

    Re: Insert picture on blank colored cells and remove all picture

    yes after i tested code with my original file its working thank you.

    There is two things need to solve it please help.

    1. in have my master file there are some rows will be need to hide and unhide so when i hide the rows the pictures are not hiding it shows in all front of the first row. how to make if hide the rows also picture to hide it. see the attached picture.

    2. when i select the remove picture button only in name of vanamo_logo.png should remove pictures and not to remove other name of the pictures in sheet like ( i have a header logo which is other name of pictures) its totally remove all pictures from the active sheet.
    Attached Images Attached Images

  14. #14
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,236

    Re: Insert picture on blank colored cells and remove all picture

    To solve no 1...add red part in existing code...This will allow the images to hide with row
    Please Login or Register  to view this content.
    To solve no 2...
    Please Login or Register  to view this content.
    Last edited by sintek; 06-05-2018 at 02:37 AM.

  15. #15
    Forum Contributor
    Join Date
    12-14-2016
    Location
    UAE
    MS-Off Ver
    MS OFFICE 2016 & 2019
    Posts
    154

    Re: Insert picture on blank colored cells and remove all picture

    Hi sir,

    i tested with your code the solve no:1 is solved its working perfectly.

    The solve no:2 is not working its removed the other name of the pictures too.

    sir i attached the my master file which i currently working for shift schedule for multi years to generate. Actually i need to be like this format. please check the file to solve the problems.

    if clicking spin button to change years of schedule can you give me the code for that it will be more benefits and happy to me.
    Attached Images Attached Images
    Attached Files Attached Files

  16. #16
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,236

    Re: Insert picture on blank colored cells and remove all picture

    The solve no:2 is not working its removed the other name of the pictures too.
    That is because your code is wrong...
    Please Login or Register  to view this content.
    Pictures on sheet of your uploaded sample is...
    Please Login or Register  to view this content.
    if clicking spin button to change years of schedule can you give me the code for
    I suggest you open another thread with your new requirements as this one in my meaning is solved...

  17. #17
    Forum Contributor
    Join Date
    12-14-2016
    Location
    UAE
    MS-Off Ver
    MS OFFICE 2016 & 2019
    Posts
    154

    Re: Insert picture on blank colored cells and remove all picture

    Hi sir,

    Thanks for mention the wrong code after i replace the name of pic of both logo1 & logo2 the header pictures not removed working good but again i tested to remove the pic of vanamo_logo.png its not removing showing " Run time 13 error "

    please advice what is wrong..

    it is possible to show as single picture in blank cells not two picture in same blank of cells.

    i will make solved the thread after this working and i will make new thread with spin create year calendar.
    Attached Images Attached Images
    Attached Files Attached Files

  18. #18
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,236

    Re: Insert picture on blank colored cells and remove all picture

    Above code works fine...No errors...
    It deletes all pictures except for logo1 & logo2

    This will solve single pic insert in blank merged cells
    Please Login or Register  to view this content.
    Last edited by sintek; 06-05-2018 at 03:46 PM.

  19. #19
    Forum Contributor
    Join Date
    12-14-2016
    Location
    UAE
    MS-Off Ver
    MS OFFICE 2016 & 2019
    Posts
    154

    Re: Insert picture on blank colored cells and remove all picture

    Hi sir,

    Awesome its working thank you so much thanks a lot.

  20. #20
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,236

    Re: Insert picture on blank colored cells and remove all picture

    My pleasure...Glad I could assist. tx for rep+
    Please remember to mark thread as solved...

  21. #21
    Forum Contributor
    Join Date
    12-14-2016
    Location
    UAE
    MS-Off Ver
    MS OFFICE 2016 & 2019
    Posts
    154

    Re: Insert picture on blank colored cells and remove all picture

    HI sir,

    i need help to solve this issues again when i tried to inserted the pictures first on hide rows the pictures are not places on blank cells its shows all pictures on visible rows only. see the attached picture1

    Then also i got noticed that Error message " Run time 13 error " on Remove_all Pic module because of activesheet first images not showing.

    Ex: when active sheet i tried to insert the picture and after i hide the rows and giving delete pictures button then macro not delete the hiding rows of pictures, after i unhide the rows the pictures are remain there as look like attached picture2.

    please could you solve this problems.
    Attached Images Attached Images
    Attached Files Attached Files

  22. #22
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,236

    Re: Insert picture on blank colored cells and remove all picture

    Why are you hiding rows and then inserting pics and then unhiding...
    First insert pics, then hide ...then unhide..

+ 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] Modify VBA to insert picture embedded in file instead of a link to a picture
    By edthedrummer in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-25-2017, 02:12 AM
  2. [SOLVED] insert picture the same size and location of existing picture
    By mcdermott2 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-13-2015, 11:14 AM
  3. [SOLVED] Insert Picture in cell, click commanbutton to rename picture, lock cell and remove button
    By thecdnmole in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-28-2014, 10:05 PM
  4. VB code to insert picture when email picture not in excel
    By T_BOLT in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-07-2014, 06:42 AM
  5. VBA for Picture insert at particular worksheet range. Picture name derived from cell.
    By Douglas2013 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-09-2013, 01:16 AM
  6. Creating macro to insert a picture by including specific picture name & path
    By NissaFrenchRamsteyn in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-09-2012, 05:40 AM
  7. [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

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