×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Based on Formula, can I show a particular bitmap?

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.

RE: Based on Formula, can I show a particular bitmap?

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

RE: Based on Formula, can I show a particular bitmap?

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

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources