ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Is this "If Statement" Possible? (https://www.excelbanter.com/excel-programming/288709-if-statement-possible.html)

pete

Is this "If Statement" Possible?
 
I want an if statement like "=if(a1=1,"A","B")" instead of
inserting the A or B I want it to insert a picture file in
the cell. "=if(a1=1,Picture A,Picture B)" Is this
possible?

Thanks
Pete

Tushar Mehta

Is this "If Statement" Possible?
 
Unfortunately, that is not possible. A formula can only change the
value in the cell. Also, images in XL are never *in* a cell. They
reside in a layer that 'floats' above the cells.

--
Regards,

Tushar Mehta, MS MVP -- Excel
www.tushar-mehta.com
Excel, PowerPoint, and VBA add-ins, tutorials
Custom MS Office productivity solutions

In article ,
says...
I want an if statement like "=if(a1=1,"A","B")" instead of
inserting the A or B I want it to insert a picture file in
the cell. "=if(a1=1,Picture A,Picture B)" Is this
possible?

Thanks
Pete


beeawwb[_6_]

Is this "If Statement" Possible?
 
What about with VBA? This is something that's intrigued me for a while,
and I've been waiting for a project where I might get to test it out.

Specifically, I was thinking in terms of a card game. Have an array of
52 cards, and 52 card pictures stored on the hard drive. Based upon
what random value was called, load a picture.

So, for example, if the array randomly selects DI,4 (4 of Diamonds)
then make the first picture DI4.jpg

Any way to have VBA code change / modify OLE objects? I know in access
I had a way to do it, where I stored 52 pictures as an OLE table. But
Excel doesnt work that way.

So, any light that can be shed on that, thanks. :)

-Bob


---
Message posted from http://www.ExcelForum.com/


Tushar Mehta

Is this "If Statement" Possible?
 
Turn on the macro recorder (Tools | Macro Record new macro...),
insert an image from a file, delete the inserted image, and turn off
the recorder.

XL will give you the necessary starter code that you can then modify
and generalize.

--
Regards,

Tushar Mehta, MS MVP -- Excel
www.tushar-mehta.com
Excel, PowerPoint, and VBA add-ins, tutorials
Custom MS Office productivity solutions

In article , beeawwb
says...
What about with VBA? This is something that's intrigued me for a while,
and I've been waiting for a project where I might get to test it out.

Specifically, I was thinking in terms of a card game. Have an array of
52 cards, and 52 card pictures stored on the hard drive. Based upon
what random value was called, load a picture.

So, for example, if the array randomly selects DI,4 (4 of Diamonds)
then make the first picture DI4.jpg

Any way to have VBA code change / modify OLE objects? I know in access
I had a way to do it, where I stored 52 pictures as an OLE table. But
Excel doesnt work that way.

So, any light that can be shed on that, thanks. :)

-Bob


---
Message posted from http://www.ExcelForum.com/




All times are GMT +1. The time now is 05:52 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com