Help - Insert photos from directory
The first part is easy. Using the Macro Recorder:
Sub Macro1()
'
' Macro1 Macro
' Macro recorded 1/20/2009 by James Ravenswood
'
'
Range("B9").Select
ActiveSheet.Pictures.Insert("C:\test\pic demo_files\image001.jpg").Select
Range("A1").Select
End Sub
However, the picture is not really "in" a cell. It just rests on top of the
cells. You can move it and re-size it with a macro, but another alternative
might be to put a button the the worksheet and put the picture on the button.
--
Gary''s Student - gsnu200828
"Stevep4" wrote:
I have downloaded and installed the "morefunc" add ins which allows me to
access information from closed workbooks.
for example
=INDIRECT.EXT("'G:\shared\MyName\npms\data\["&B4&".xls]Sheet1'!$B$1")
Now what I need to do is download a photo into a cell.
Firstly
I would like to ensure that I can pull a photo (just to prove it at the
simplest level - before we make it complicated). So, in the local drive I
have a picture.
Filename "c:\lg.jpg"
What is the code I would need to get that to drop into a worksheet??
ultimately, I want to pull a photo from a specified drive on the network.
The file name would be provided from another cell in the worksheet (see code
above).
I need the macro code that would insert the photo into a specified cell and
scale it to fill the cell.
Can someone provide some code??
|