View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default How to use the content of a cell as a file name

http://www.mcgimpsey.com/excel/lookuppics.html

If that isn't exactly what you want, it should give you all the information
you need.

if you want your simplified code:

ActiveSheet.Unprotect
Range("E2:H18").Select
sName = Worksheets("Sheet1").Range("A1").Text
ActiveSheet.Pictures.Insert(s).Select

Selection.ShapeRange.LockAspectRatio = msoTrue
Selection.ShapeRange.Height = 216#
Selection.ShapeRange.Width = 288#
Selection.ShapeRange.Rotation = 0#


--
regards,
Tom Ogilvy


"cyrus" wrote in message
...
I Like to have a macro that looks at the content of a specific cell in the
sheet to get the file name neede to insert the picture in a specific cell.
This would be same function for all the sheets except sheet(cover).
Here is the recorded macro:
ActiveSheet.Unprotect
Range("E2:H18").Select
ActiveSheet.Pictures.Insert( _ """" this is where I want to unsert the
cell that has file name"""'
"C:\Documents and Settings\Vince Aragona\My Documents\My
Pictures\101MSDCF\101MSDCF\DSC00002.JPG" _
).Select
Selection.ShapeRange.LockAspectRatio = msoTrue
Selection.ShapeRange.Height = 216#
Selection.ShapeRange.Width = 288#
Selection.ShapeRange.Rotation = 0#

Any help would be greatly appreciated.
--
CY