Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Based on Formula, can I show a particular bitmap?

Status
Not open for further replies.

AndyZ

Structural
Nov 13, 2002
11
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.
 
Replies continue below

Recommended for you

i am not certain how to do it in a VBA macro, but in a VB6 program you would put an image control box on the form (insert an image control in your EXCEL sheet, set stretch property to true). then, in an if statement, use the LOADPICTURE command....like.....

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
 
Sub delete()
'
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor