adding a graphic using a conditional

  • Thread starter Thread starter drepsac
  • Start date Start date
D

drepsac

How can I add a clip art image to a specific location for a "true
result of a conditional
 
Since worksheet functions can only return values (they can't affect
images, borders, colors, etc), you'll need to use an event macro.
One way:

Paste your image onto the sheet and position the way you want. Name
it, say, "image1".

Since you didn't specifiy a condition, assume the condition is that
J1 > 0 and that J1 has a formula in it.

Put this in your worksheet code module (right-click on the worksheet
tab, choose View code):

Private Sub Worksheet_Calculate()
Me.Shapes("image1").Visible = (Range("J1") > 0)
End Sub
 

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

Back
Top