Using formulae to display pictures....

  • Thread starter Thread starter matt_123
  • Start date Start date
M

matt_123

Hopefully there is somebody that can help me with this predicament.
regularly compile quizzes on excel which get sent out & are now viewe
as far afield as the US (im in the UK), but for one particular quiz
would like to set up I am having trouble with achieving something.
What I am after is a way in which a cell(s) can show part of a pictur
(eg part of a face) for the user to try & identify, but then when the
enter the correct answer, the picture changes to full size. Whethe
this involves resizing or replacing the picture, formulae, conditiona
formating etc I am not bothered. I have racked my mind tryin
everything I can think of :confused:, but have hit a very large wal
which I cant get past!

Hopefully somebody out there can help!

Cheers, Mat
 
Hi,

Here is a macro which I am calling from a button -
which switches between 3 different pictures. Adjust
down to 2; load both: the partial and then the final
and switch.

also including a HidePix macro (I use this in auto_open)
these aren't elequent code, but they work for me.

good luck
jeff

Public Sub HidePix()
Dim nobj As Integer
Dim pic(5) As Variant
nobj = Application.ActiveSheet.Pictures.Count
For J = 1 To nobj
If Left(ActiveSheet.Pictures(J).Name, 7) = "Picture" Then
picnum = picnum + 1
pic(picnum) = J
End If
Next J
For J = 1 To picnum
ActiveSheet.Pictures(pic(J)).Visible = False
Next J
End Sub

Public Sub switchPix()
Dim nobj As Integer
Dim pic(5) As Variant
nobj = Application.ActiveSheet.Pictures.Count
For J = 1 To nobj
If Left(ActiveSheet.Pictures(J).Name, 7) = "Picture" Then
picnum = picnum + 1
pic(picnum) = J
End If
Next J
If ActiveSheet.Pictures(pic(1)).Visible = True Then
ActiveSheet.Pictures(pic(1)).Visible = False
ActiveSheet.Pictures(pic(2)).Visible = True
ActiveSheet.Pictures(pic(3)).Visible = False
Else
If ActiveSheet.Pictures(pic(2)).Visible = True Then
ActiveSheet.Pictures(pic(2)).Visible = False
ActiveSheet.Pictures(pic(1)).Visible = False
ActiveSheet.Pictures(pic(3)).Visible = True
Else
ActiveSheet.Pictures(pic(3)).Visible = False
ActiveSheet.Pictures(pic(2)).Visible = False
ActiveSheet.Pictures(pic(1)).Visible = True
End If
End If
End Sub
 
Hi!

The simple way is to have 2 pictures: one is partial; the other i
whole.

Replace the partial with the whole to "reveal" the hidden bits.

Al
 

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