Solved

Excel VBA - Add an image to a sheet and name it

Posted on 2014-03-09
2
457 Views
Last Modified: 2014-03-10
Hi

What VBA code would I use to add an image to a specific Excel cell and name it
0
Comment
Question by:murbro
2 Comments
 
LVL 81

Accepted Solution

by:
zorvek (Kevin Jones) earned 500 total points
ID: 39916827
This code inserts a picture positioned on cell C3 on Sheet1:

        With ThisWorkbook.Sheets("Sheet1").Pictures.Insert("C:\Users\Kevin Jones\Pictures\IM Avatars\zorvek.jpg")
        .ShapeRange.IncrementLeft ThisWorkbook.Sheets("Sheet1").Range("C3").Left
        .ShapeRange.IncrementTop ThisWorkbook.Sheets("Sheet1").Range("C3").Top
        .Name = "MyPicture"
    End With

Open in new window

Kevin
0
 

Author Closing Comment

by:murbro
ID: 39916856
Thanks very much
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Approximate matching with VLOOKUP and MATCH seems to me to be a greatly under-used technique, and one which is vital for getting good performance out of large lookups. Until recently I would always have advised using an exact match for simplicity an…
Improved? Move/Copy Add-in Replacement - How to avoid the annoying, “A formula or sheet you want to move or copy contains the name XXX, which already exists on the destination worksheet.” David Miller (dlmille)  It was one of those days… I wa…
This Micro Tutorial will demonstrate on a Mac how to change the sort order for chart legend values and decrpyt the intimidating chart menu.
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now