View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
djk44 djk44 is offline
external usenet poster
 
Posts: 3
Default Insert picture based on cell value (unlimited)

Thanks for the input. I will be using a listbox control that returns a name
(using a vlookup function). When I select the name, the assigned name of the
image will flow into the worksheet. The macro can then lookup in the same
path, the exact image name and enter the image into a given cell range
location.

When I record the macro, this is the code.
ActiveSheet.Pictures.Insert( _
"C:\Documents and Settings\Dave Knight\My Documents\My
Pictures\football.jpg"). _ '"football.jpg" is the image I would like to have
chosen by the value within a cell in the worksheet (ie. soccer.jpg,
baseball.jpg, etc.)
Select
Selection.ShapeRange.ScaleWidth 0.45, msoFalse, msoScaleFromBottomRight
Selection.ShapeRange.ScaleHeight 0.45, msoFalse, msoScaleFromBottomRight
Selection.ShapeRange.IncrementLeft -59.25
Selection.ShapeRange.IncrementTop -273#
Selection.ShapeRange.ScaleWidth 0.75, msoFalse, msoScaleFromBottomRight
Selection.ShapeRange.ScaleHeight 0.75, msoFalse, msoScaleFromBottomRight

Anymore detailed help is greatly appreciated.

--
djk44


"NickHK" wrote:

Record a macro whilst you insert the picture manually.

Then edit/include that in the required event, probably:
Private Sub ComboBox1_Click()
End Sub
where ComboBox1.Text gives you selected text.

Depends how you are matching the selected name to the required graphic.

NickHK

"djk44" wrote in message
...
I am looking to insert a picture based on a cell value. The exact

application
is to insert the picture of a person based on choosing their name from a
drop-down list. Anybody have any suggestions; VBA or other? Thank you in
advance for the help.
--
djk44