Hi there, this is my first post here, just looking for some help with an assignment i've been given as my lecturer is useless.
Sorry i meant to post this in Excel section.
I have created a quiz with images that gives you point upon clicking the correct one, but the problem is you can click any image multiple times until you get the right one.
I was looking for something that would work like this:
Click Pic1 >
Pic2, Pic3 and Pic4 all go invisible
I know the macro command (.Visible = False) but im not sure how i would code this so it would work?
Here's what my VB statement looks like at the moment
And heres something i came up with (which encountered errors naturally).Sub Picture6_Click()
MsgBox "WRONG!", vbOKOnly, "Incorrect"
Range("G73").Value = "0"
End Sub
_________________________________________________________
Sub Picture7_Click()
MsgBox "WRONG!", vbOKOnly, "Incorrect"
Range("G73").Value = "0"
End Sub
_________________________________________________________
Sub Picture8_Click()
MsgBox "WRONG!", vbOKOnly, "Incorrect"
Range("G73").Value = "0"
End Sub
_________________________________________________________
Sub Picture9_Click()
MsgBox "Correctamundo!", vbOKOnly, "Correct"
Range("G73").Value = "2"
End Sub
Sub Hide()
If Picture6_Click = True Then
Picture6.Visible = False
ElseIf Picture7_Click() = True Then
Picture7.Visible = False
ElseIf Picture8_Click() = True Then
Picture8.Visible = False
Last edited by Sauc; 11-17-2011 at 03:16 AM.
How about
Picture6.Enabled = False
Sub Picture6_Click() MsgBox "WRONG!", vbOKOnly, "Incorrect" Range("G73").Value = "0" Picture6.Enabled = False End Sub
Contributors to this forum do not get paid. They give their valuable time to help you solve your problem. That's why feel free to CLICK their STARicon to say thank you -even the given idea/solution didn't really solve your queries. The time given to you deserves a small gratitude anyway.
Dare to give a pencil to a child. http://www.blackpencilproject.org/
I tried this but i get an error
"Run-time error '424':
object required.
Thanks for the help.
NOTE: Sorry i've realised now that this is in the wrong section, it was intended for Excel but i wasnt paying enough attention
My apologies :p
Last edited by Sauc; 11-17-2011 at 03:18 AM.
Sorry didn't notice its a module
try to move your codes to General
then use
private sub - end sub
Private Sub Picture6_Click() Picture6.Enabled = False End Sub
Contributors to this forum do not get paid. They give their valuable time to help you solve your problem. That's why feel free to CLICK their STARicon to say thank you -even the given idea/solution didn't really solve your queries. The time given to you deserves a small gratitude anyway.
Dare to give a pencil to a child. http://www.blackpencilproject.org/
Sampler to hide and unhide
Contributors to this forum do not get paid. They give their valuable time to help you solve your problem. That's why feel free to CLICK their STARicon to say thank you -even the given idea/solution didn't really solve your queries. The time given to you deserves a small gratitude anyway.
Dare to give a pencil to a child. http://www.blackpencilproject.org/
Took this and modified slightly.
Heres how it is
So when i click one the rest go invisible. The Command Box is to reset it and is going to be locked.Private Sub CommandButton1_Click()
Image1.Visible = True
Image2.Visible = True
Image3.Visible = True
Image4.Visible = True
End Sub
Private Sub Image1_Click()
MsgBox "WRONG!!", vbOKOnly, "Incorrect"
Range("G73").Value = "0"
Image2.Visible = False
Image3.Visible = False
Image4.Visible = False
Thanks a lot vlady :D
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks