Add a shape from no of shapes according to cell value

mavisuruwa

New Member
Joined
Jun 15, 2015
Messages
1
Hi,

I'm a newbie, an engineer assigned to do lots of re-bar detailing. I did it manually until now and seeking help to produce an excel program. Basically, most of parameters can be programmed using excel's common commands. However I have this question. How can I add a specific shape/picture to a cell according to a value input to a cell? I have nearly 400 shapes in hand. I know that VBA scripts can do it, but don't know how. Thanks in advanced.

K
 

Some videos you may like

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest

yky

Well-known Member
Joined
Jun 7, 2011
Messages
1,812
Office Version
  1. 2010
Platform
  1. Windows
The following is the code I just posted a few days ago for adding a picture to the active cell, the cell one just double-clicked. You can modify it to suit your need. You need to change the path and file name, the Left and Top to the cell you want to picture to be pasted to, and Width and Height of the picture.

Code:
[COLOR=#333333]Dim p As Object[/COLOR]

Set p = ThisWorkbook.Sheets(1).Shapes.AddPicture(Filename:="D:\PICTURE DATABASE\DSC02029.JPG", LinkToFile:=False, _
SaveWithDocument:=True, Left:=ActiveCell.Left, Top:=ActiveCell.Top, Width:=153, Height:=204)
 

Watch MrExcel Video

Forum statistics

Threads
1,122,658
Messages
5,597,403
Members
414,142
Latest member
Banyangt

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top