if value entered, then do this

J

Jeremy

I found a UDF on the web that makes a picture (from a pre defined folder
containing student pictures) pop up in a web sheet. So, in my spread sheet,
I have the following colums:StudentID,First,Last,Advisor,P1,P2,P3,P4,P5.
Then I have a colum with the formula to grab the picture: =ShowPic("c:\my
documents\my pictures\Larson07b.jpg"). But I only want the formula ran if
the user wants to see the picture. How can I do that? Doe I have to set up
another column that says something like, If the user says yes in this column,
then do =ShowPic("c:\my documents\my pictures\Larson07b.jpg")??
Thanks
 
D

Dave Peterson

I have no idea how the function works, but maybe you use:

=if(a1<>"Yes","",showpic(...))

or include the cell in your call to the =showpic() function:

=showpic(a1,"c:\....")

And inside the function, check that cell:

function showpic(mycell as range, myPictName as string) as ...

if lcase(mycell.cells(1).value) <> lcase("yes") then
'do nothing
else
'your code here
end if

End function
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top