Based on Formula, can I show a particular bitmap?
Based on Formula, can I show a particular bitmap?
(OP)
I have a formula which tells me how the forces are arranged on a free body diagram. Is there a way to force it to display a particular bit map picture.
If I wanted text, I could use an if statement and then specify the resulting text to display. Can I use something similar for an object or a bitmap.
If I wanted text, I could use an if statement and then specify the resulting text to display. Can I use something similar for an object or a bitmap.





RE: Based on Formula, can I show a particular bitmap?
imagebox1.picture=Loadpicture("C:\myfolder\mypic.bmp")
not sure if you would do an if statement in a cell or by way of a VBA macro.
daveleo
RE: Based on Formula, can I show a particular bitmap?
'
Here's example code I use in a vessel volume workbook. This has different images depending on head type. I also have a button in which you click to select head type. (Macros are assigned to these buttons)
' Deletes previously inserted pictures
'
Sheets("Vessel Volume").Shapes("Picture1").Select
Selection.delete
End Sub
Sub move()
'
' Relocates picture to correct location
'
Sheets("Vessel Volume").Shapes("Picture1").Select
Selection.ShapeRange.IncrementLeft 288.75
Selection.ShapeRange.IncrementTop 81.75
End Sub
Sub resize()
'
' Resizes picture to correct size
'
Sheets("Vessel Volume").Shapes("Picture1").Select
Selection.ShapeRange.ScaleHeight 0.77, msoFalse, msoScaleFromTopLeft
End Sub
Sub Conical_Insert()
'
' Inserts Conical head picture
'
Call delete
Sheets("Pictures").Select
ActiveSheet.Shapes("Conical").Select
Selection.Copy
Sheets("Vessel Volume").Select
Range("A2").Select
ActiveSheet.Paste
ActiveSheet.Shapes("Conical").Select
Selection.Name = "Picture1"
Call move
Call resize
Range("E17").Select
End Sub
Sub Ellipsoidal_Insert()
'
' Inserts Ellipsoidal head picture
'
Call delete
Sheets("Pictures").Select
ActiveSheet.Shapes("Ellipsoidal").Select
Selection.Copy
Sheets("Vessel Volume").Select
Range("A2").Select
ActiveSheet.Paste
ActiveSheet.Shapes("Ellipsoidal").Select
Selection.Name = "Picture1"
Call move
Call resize
Range("E17").Select
End Sub