+ Reply to Thread
Results 1 to 11 of 11

Insert picture into a single cell

  1. #1
    Registered User
    Join Date
    07-14-2010
    Location
    Limington, Maine
    MS-Off Ver
    Excel 2003
    Posts
    16

    Question Insert picture into a single cell

    Hello all,

    I was wondering if it were possible to anchor an image to only a single cell. Now, I don't want to accomplish this through a hyperlink, that is, I want to be able to copy/paste an image directly into a cell, rather than having it float over multiple ones.

    I know there are ways of doing this, such as cell comments and hyperlinks, but I don't want to accomplish this that way.

    The desired functionality is to be able to paste an image into a selected cell, anchor it to the cell, then resize the cell around the image.

    Also, is there a way to get a handle on the image once it's on the worksheet? I can't seem to find any VBA functions that will do this.

    Thanks,
    Mark

  2. #2
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Insert picture into a single cell

    Have alook at this demo workbook, it might point you in the right direction.
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    07-14-2010
    Location
    Limington, Maine
    MS-Off Ver
    Excel 2003
    Posts
    16

    Re: Insert picture into a single cell

    I enlarged one of your flag images and attempted to copy/paste special into a single cell, but the image just floated across multiple cells. Perhaps I'm missing something or poorly phrased the question?

    I want this functionality to be automated, which means that after resizing the flag image and pasting into a cell, I would want the sheet to exhibit the functionality I mentioned in my first post.

    Sorry for the confusion.

  4. #4
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Insert picture into a single cell

    Sorry it was the code in the workbook I meant you to look at.

    To move and position the flags.
    Select a new team from the dropdown lists.

  5. #5
    Registered User
    Join Date
    07-14-2010
    Location
    Limington, Maine
    MS-Off Ver
    Excel 2003
    Posts
    16

    Re: Insert picture into a single cell

    Hmm ... so, I chose a team from the dropdown list, but the respective flag did not move into the same cell. Actually, no flag moved into the cell, only the team name.

  6. #6
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Insert picture into a single cell

    Do you have macros enabled? It's working fine for me.

  7. #7
    Registered User
    Join Date
    07-14-2010
    Location
    Limington, Maine
    MS-Off Ver
    Excel 2003
    Posts
    16

    Re: Insert picture into a single cell

    Ah! ... I accidentally corrupted your file. It works fine now. Hopefully this helps. Thanks for the help! I'll report whether or not this was successful.

    Much appreciated,
    Mark

  8. #8
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Insert picture into a single cell

    Okay,
    Remember it's only a demo, its part of a bigger file.

    Have fun.....

  9. #9
    Registered User
    Join Date
    06-23-2010
    Location
    Dallas, TX
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Insert picture into a single cell

    Nice file Marcol...thanks for posting.

  10. #10
    Registered User
    Join Date
    04-10-2013
    Location
    United States
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: Insert picture into a single cell

    Marcol,
    This is exactly what i have been trying to do, but being very new to VBA my knowledge is limited. I need to import a picture to a cell based on another cells value. Example: if A1="Yes", insert picture in cell B1.

    Do you have a simple explanation on how I can do this? I have tried a couple of other threads but can't seem to figure out how to link the picture i need to import it. i was hoping a simple IF function would have worked but since the pictures are not linked to the cell I just import a blank cell.

    Any help here would be great. Thanks

  11. #11
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Insert picture into a single cell

    PMChagnon,

    Unfortunately you need to post your question in a new thread, it's against the forum rules to post a question in the thread of another user. If you create your own thread, any advice will be tailored to your situation so you should include a description of what you've done and are trying to do. Also, if you feel that this thread is particularly relevant to what you are trying to do, you can surely include a link to it in your new thread.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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