Create macro to read filename in a column and insert same name file in cell as a picture
Posted on 2007-12-07
I would like to know how I can create a macro that when run will look in a cell for a filename and if one exists, look on the hard drive in a folder for an image with same filename and then place that image in the cell next to the one with the filename.
i.e cell A1 would be blank, cell B1 would contain the text "image1"
i would want the macro to read the name of the image in cell B2, then look in a folder for an image file with the same name, then place that image into cell A1.
I would want to run it on a range of entries, for example B1-B20 may all contain image names.
Also the column with the image names may only contain part of the image name, and it would not have the extension, so I would need it to take the entry of B1 in the above example, and add .gif, so the filename its searching for would be image1.gif