+ Reply to Thread
Results 1 to 7 of 7

VBA for Inserting Photos for Individual Cell, Possible?

  1. #1
    Registered User
    Join Date
    07-20-2018
    Location
    Tokyo
    MS-Off Ver
    Office 365
    Posts
    3

    VBA for Inserting Photos for Individual Cell, Possible?

    Dear genius vba users,

    I am trying to work out a database for my products. And what I did was that I added the product photos to each cell's comment.
    So every time when I want to check my product photo, I will just move my mouse to it, the photo will pop out as a comment.

    1532065172775.jpg
    Sorry that it is in Japanese, but I am sure you all excel genius knows what I am trying to say... I hope...

    All my products are entered in column A now, But the thing is, is that there are hundreds of products, I really don't what to do it one by one BY HAND.

    So lets say,
    I have lists of products, lets say column A in my excel are all my product codes (for exmaple, A-1, A-2, A-3, so on...).

    And for those products, I have photos' file name named under its product codes (for exmaple, A-1, A-2, A-3, so on...). All these photos are in one folder.

    I am trying to "link" all the photos to its product codes in column A, by the "comment" feature of excel I mentioned above, is this possible to do this by vba?

    Sorry I am a completely newbie to vba, I have no background of coding either.
    But comparing to the time of selecting one photo by one photo for over hundreds of products, I think I should just try to know the basic... Any help?
    Last edited by koshinohouse; 07-20-2018 at 05:14 AM.

  2. #2
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,908

    Re: Can VBA Do This?

    Here you go.
    Set mypath to correct filepath. Also check extension is set correctly. (set to jpg now)
    Please Login or Register  to view this content.
    Avoid using Select, Selection and Activate in your code. Use With ... End With instead.
    You can show your appreciation for those that have helped you by clicking the * at the bottom left of any of their posts.

  3. #3
    Registered User
    Join Date
    07-20-2018
    Location
    Tokyo
    MS-Off Ver
    Office 365
    Posts
    3

    Re: Can VBA Do This?

    Amazing speed! thank you bakerman2!
    I will look into this code and try to learn it by breaking it down! Please allow me for asking more questions later

    But one quick question!
    For example, if I did 10 products today, and next day, I added 10 more, can I run the same macro? will it pick it up and start auto update the new data?

    Thank you!
    Last edited by koshinohouse; 07-20-2018 at 03:35 AM.

  4. #4
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,908

    Re: Can VBA Do This?

    This one checks for existing comment first.
    Please Login or Register  to view this content.

  5. #5
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    81,247

    Re: Can VBA Do This?

    Welcome to the forum! Please take a moment to re-read forum rule #1 and then amend your thread title to something that better explains your problem. Changing your thread title is not optional, which means you must change it. Thanks!

    • Use concise, accurate thread titles.
    • Your post title should describe your problem, not your anticipated solution.
    • Use terms appropriate to a Google search - poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice tell us nothing.
    • Responding to a request to change your thread title by doing so is mandatory.

    To change a title go to your first post, click EDIT then Go Advanced and change your title.

    No help to be offered, please, until the OP complies with this request.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  6. #6
    Registered User
    Join Date
    07-20-2018
    Location
    Tokyo
    MS-Off Ver
    Office 365
    Posts
    3

    Re: Can VBA Do This?

    Done! Sorry about this.

  7. #7
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,908

    Re: VBA for Inserting Photos for Individual Cell, Possible?

    Thanks for rep+.

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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