Using a disclaimer in excel

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have figured out the userform to create a disclaimer and it pops up when I
open the workbook but how do I get the work book to open/close according to
the selection they make. Right now it only closes via the cross, and the
option buttons in the user form don't do anything.

The code i am using to get the userform to come up is:
Private Sub Workbook_Open()
Application.ScreenUpdating = True
PopQuiz.Show
Application.ScreenUpdating = False
End Sub

Answers in laymens terms please as i am a beginner!!

Thanks
 
Use the change event of the control

Private Sub Optionbutton1_Click()
if OptiongButton1.Value = True then
Unload me
ThisWorkbook.Close SaveChanges:=True
end if
End Sub

This code would go in the userform module. In the userform module, the "Me"
refers to that userform.
 
Tom

Thanks for your help but I didn't understand?!? Perhaps you can explain it a
bit mroe simply for me? I have only used VB today for the first time!

Thanks
Daniya
 

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