+ Reply to Thread
Results 1 to 29 of 29

Macro to pull pictures from folder to cells

  1. #1
    Registered User
    Join Date
    12-05-2013
    Location
    United States
    MS-Off Ver
    Excel 2016
    Posts
    31

    Macro to pull pictures from folder to cells

    I have an excel sheet where column "B" has a list of style numbers . I also have a folder with pictures of each product and file name of the pictures are the product code. I would like to place the picture of each product in column "A" beside their respective codes. If possible, I would also like to reformat the pictures so they fit in the cell. Size= (3.00 x 3.85)

    I want to be able to press for example :CTRL Q and all the the pictures will pull from the folder on my PC and populate in column A next to their respective style # in column B.

    Need a Macro that can run this.
    I don't really know where to start and any help would be greatly appreciated!
    If anyone could write this code that would be great.
    Thanks
    Last edited by iowitz; 12-09-2013 at 04:10 PM.

  2. #2
    Forum Contributor
    Join Date
    09-24-2013
    Location
    Dallas, Texas
    MS-Off Ver
    Excel 2007
    Posts
    128

    Re: Macro to pull pictures from folder to cells

    Try this..
    Please Login or Register  to view this content.
    hope this helps

  3. #3
    Registered User
    Join Date
    12-05-2013
    Location
    United States
    MS-Off Ver
    Excel 2016
    Posts
    31

    Re: Macro to pull pictures from folder to cells

    Is it possible for you to change the code .. i know nothing about writing code

    file " C:\Documents and Settings\Admin\Desktop\Images For Stock List By Style # "
    style #s are in row c6 - c70
    pictures should be in b6-b70
    size is 3.00x 3.85

    would be great

  4. #4
    Forum Contributor
    Join Date
    09-24-2013
    Location
    Dallas, Texas
    MS-Off Ver
    Excel 2007
    Posts
    128

    Re: Macro to pull pictures from folder to cells

    What type of pics do you have? gif, jpg, bmp ,tif

    is this the folder name? Images For Stock List By Style #

    the macro will size the pics to what ever the cell size is.
    Last edited by moonsaga; 12-09-2013 at 06:32 PM.

  5. #5
    Registered User
    Join Date
    12-05-2013
    Location
    United States
    MS-Off Ver
    Excel 2016
    Posts
    31

    Re: Macro to pull pictures from folder to cells

    all my pictures are jpg
    folder name is " Images For Stock List By Style # "

  6. #6
    Forum Contributor
    Join Date
    09-24-2013
    Location
    Dallas, Texas
    MS-Off Ver
    Excel 2007
    Posts
    128

    Re: Macro to pull pictures from folder to cells

    I modified the code to your request...

    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    12-05-2013
    Location
    United States
    MS-Off Ver
    Excel 2016
    Posts
    31

    Re: Macro to pull pictures from folder to cells

    can I just copy and paste what you posted ..if not can you make it so I can do so
    Thanks

  8. #8
    Forum Contributor
    Join Date
    09-24-2013
    Location
    Dallas, Texas
    MS-Off Ver
    Excel 2007
    Posts
    128

    Re: Macro to pull pictures from folder to cells

    Yes .. copy and paste into the sheet object.
    once the workbook is open right click on the sheet tab and click on "View code" then paste into the window that opens.
    save worksheet
    go to excel and hit "ALT + F8 to bring up the macro run window
    then highlight the macro and click on the options button
    then you can assign a shortcut key to the macro.

  9. #9
    Registered User
    Join Date
    12-05-2013
    Location
    United States
    MS-Off Ver
    Excel 2016
    Posts
    31

    Re: Macro to pull pictures from folder to cells

    Copy even the comments you made on the sheet?

  10. #10
    Forum Contributor
    Join Date
    09-24-2013
    Location
    Dallas, Texas
    MS-Off Ver
    Excel 2007
    Posts
    128

    Re: Macro to pull pictures from folder to cells

    its up to you .. i put the comments there so that you would know what part of the code does what. the comments will be ignored by the vba due to the single quote.

  11. #11
    Registered User
    Join Date
    12-05-2013
    Location
    United States
    MS-Off Ver
    Excel 2016
    Posts
    31

    Re: Macro to pull pictures from folder to cells

    Im getting an error that says " 400 "

  12. #12
    Forum Contributor
    Join Date
    09-24-2013
    Location
    Dallas, Texas
    MS-Off Ver
    Excel 2007
    Posts
    128

    Re: Macro to pull pictures from folder to cells

    Can you upload your workbook so that i can debug the 400 error code?

  13. #13
    Registered User
    Join Date
    12-05-2013
    Location
    United States
    MS-Off Ver
    Excel 2016
    Posts
    31

    Re: Macro to pull pictures from folder to cells

    how can I upload it?

  14. #14
    Registered User
    Join Date
    12-05-2013
    Location
    United States
    MS-Off Ver
    Excel 2016
    Posts
    31

    Re: Macro to pull pictures from folder to cells


  15. #15
    Forum Contributor
    Join Date
    09-24-2013
    Location
    Dallas, Texas
    MS-Off Ver
    Excel 2007
    Posts
    128

    Re: Macro to pull pictures from folder to cells

    In the Quick reply there is a button named "Go advanced" on the lower right. click on it.
    then there is a button named "manage attachments" under attachment section. click on the button.
    A new window will pop up . on the right side there will be a button named "Add files" click on it.
    a small window will pop up click on "select files"

  16. #16
    Forum Contributor
    Join Date
    09-24-2013
    Location
    Dallas, Texas
    MS-Off Ver
    Excel 2007
    Posts
    128

    Re: Macro to pull pictures from folder to cells

    Quote Originally Posted by iowitz View Post
    I cant access this link. im at work and the security settings will not allow it.

  17. #17
    Registered User
    Join Date
    12-05-2013
    Location
    United States
    MS-Off Ver
    Excel 2016
    Posts
    31

    Re: Macro to pull pictures from folder to cells

    here is the file see attached thank you I need it done on all of the tabs
    Attached Files Attached Files

  18. #18
    Forum Contributor
    Join Date
    09-24-2013
    Location
    Dallas, Texas
    MS-Off Ver
    Excel 2007
    Posts
    128

    Re: Macro to pull pictures from folder to cells

    Try this ... let me know if it works for you.. the code was working for me..NEW STOCK LIST WIP.xlsm

  19. #19
    Registered User
    Join Date
    12-05-2013
    Location
    United States
    MS-Off Ver
    Excel 2016
    Posts
    31

    Re: Macro to pull pictures from folder to cells

    Picture1.png

    Im getting a error than this pops up in yellow

  20. #20
    Registered User
    Join Date
    12-05-2013
    Location
    United States
    MS-Off Ver
    Excel 2016
    Posts
    31

    Re: Macro to pull pictures from folder to cells

    Is there a difference btwn .jpg and .jpeg

  21. #21
    Forum Contributor
    Join Date
    12-09-2013
    Location
    India
    MS-Off Ver
    Excel 2003
    Posts
    171

    Re: Macro to pull pictures from folder to cells

    Hi,

    There is no difference between two... both are same...

    JP(E)G - Joint Photographic Experts Group

  22. #22
    Registered User
    Join Date
    12-05-2013
    Location
    United States
    MS-Off Ver
    Excel 2016
    Posts
    31

    Re: Macro to pull pictures from folder to cells

    Ok so what do I do about the error look at previous post

  23. #23
    Forum Contributor
    Join Date
    09-24-2013
    Location
    Dallas, Texas
    MS-Off Ver
    Excel 2007
    Posts
    128

    Re: Macro to pull pictures from folder to cells

    So your pic files have the EXT. Jpeg ? if so just replace jpg with jpeg.

  24. #24
    Registered User
    Join Date
    12-05-2013
    Location
    United States
    MS-Off Ver
    Excel 2016
    Posts
    31

    Re: Macro to pull pictures from folder to cells

    No they dont i was just curious but
    im getting an error still Picture1.png

  25. #25
    Forum Contributor
    Join Date
    09-24-2013
    Location
    Dallas, Texas
    MS-Off Ver
    Excel 2007
    Posts
    128

    Re: Macro to pull pictures from folder to cells

    when the error pops up what does it say ? also can you expand the window more so that you can see the entire yellow highlighted line?

  26. #26
    Registered User
    Join Date
    12-05-2013
    Location
    United States
    MS-Off Ver
    Excel 2016
    Posts
    31

    Re: Macro to pull pictures from folder to cells

    Here ya go ... Picture1.jpgPicture2.png

  27. #27
    Forum Contributor
    Join Date
    09-24-2013
    Location
    Dallas, Texas
    MS-Off Ver
    Excel 2007
    Posts
    128

    Re: Macro to pull pictures from folder to cells

    Ok after a little bit of searching i would suggest checking all the pic names with the names in your workbook . i think it is due to the code not finding the pic name that is in the workbook.

    Also after looking at your workbook again i did see that some cells have more than one Item number and after testing the code it cannot handle more than one Item number in a cell.
    Last edited by moonsaga; 12-10-2013 at 04:30 PM.

  28. #28
    Registered User
    Join Date
    12-05-2013
    Location
    United States
    MS-Off Ver
    Excel 2016
    Posts
    31

    Re: Macro to pull pictures from folder to cells

    shouldnt it still fill the cells with one style #

  29. #29
    Forum Contributor
    Join Date
    09-24-2013
    Location
    Dallas, Texas
    MS-Off Ver
    Excel 2007
    Posts
    128

    Re: Macro to pull pictures from folder to cells

    Nope because it tries to fill the pic cell with all pics or it tries to combine the multiple style # into one #..

+ 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. Pull pictures from folder to excel sheet...HELP
    By iowitz in forum Excel General
    Replies: 5
    Last Post: 12-06-2013, 03:03 PM
  2. Pull pictures from folder to excel sheet...HELP
    By iowitz in forum Excel General
    Replies: 1
    Last Post: 12-06-2013, 02:41 PM
  3. Pull pictures from folder to excel sheet...HELP
    By iowitz in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-06-2013, 02:11 PM
  4. Pull pictures from folder to excel sheet...HELP
    By iowitz in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-05-2013, 05:50 PM
  5. [SOLVED] Macro to pull in files from folder that is unknown
    By SeaniGeld in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-23-2013, 02:23 PM

Tags for this Thread

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