Hi,
The last few days I've been working on a multiple choice quiz in excel.
I have a working version that picks questions from a column and answers from another, and presents it to the user. See attached.
Now I want the questions for chapter 1 to be pictures instead of text. I added some dummy pics in the doc I attached.
I used this tutorial.
It is supposed to hide all pictures and then display one on a specified location [U]if[U] that picture's name corresponds to a cell value (which is a vlookup formula).
But I get an error on the following line
For Each oPic In Me.Pictures
Run-time error '13': Type mismatch
Complete code for that sub:
(Me.pictures.visible should be false. Is still true in attached doc.)
Private Sub Worksheet_Calculate()
Dim oPic As Picture
Me.Pictures.Visible = False
With Worksheets("Quiz").Range("L2")
For Each oPic In Me.Pictures
If oPic.Name = .Text Then
oPic.Visible = True
oPic.Top = .Top
oPic.Left = .Right
Exit For
End If
Next oPic
End With
End Sub
Does anyone see what I'm doing wrong?
Bookmarks