PDA

View Full Version : Excel file checker



smsved
2012-07-11, 06:40 PM
Hi,

Does anyone know if there is a formula that will create a hyperlink in excel, only if a file exists?

I am working on a business inventory list where the products are listed in column A and i have a hyperlink in column B so that I can easily see a picture of the item as needed. However, as new items come in and the product list changes I am having a difficult time keeping track of what I have or don't have a picture of. The current hyperlink formula i am using =HYPERLINK(....\11217-00068.jpg,"Picture") shows picture whether or not there is actually a picture. I would love for it to say "No Pic" if there is no picture. All the pictures are located in one big folder on my computer

Any help is greatly appreciated!

Ken Puls
2012-07-14, 06:15 AM
Hi there,

You need to resort to VBA to do this, but yes, I have a Use Defined Function for that. You can find it here: http://www.excelguru.ca/content.php?157-Function-To-Check-If-File-Or-Directory-(Folder)-Exists

Drop that code in a standard VBA module, then you can call it from the worksheet as =IF(FileFolderExists(A1),"","No Pic!)

Let us know if you need help implementing it at all.