HW12_sol - Private Sub btnOK_Click() message =...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Homework 12 – Due March 8 or 9 Do problem #4, p. 235. The caption of the form must contain your name. Using the <alt> + <Print Screen> keys, copy and paste the form into a Word document. Print the code for the form. Place the print out of the form first and your code second. (Don’t forget to use Option Explicit and have your name immediately after the Option Explicit statement.) Staple your pages together. Option Explicit ' Richard M. Feldman Private Sub btnCancel_Click() message = "You must not live in a Big Ten state." Unload Me End Sub
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Private Sub btnOK_Click() message = &quot;You live in &quot; &amp; lbStates.Value &amp; &quot;.&quot; Unload Me End Sub Private Sub UserForm_Initialize() use this if list not on worksheet With lbxStates .AddItem &quot;Illinois&quot; .AddItem &quot;Indiana&quot; .AddItem &quot;Iowa&quot; .AddItem &quot;Michigan&quot; .AddItem &quot;Minnesota&quot; .AddItem &quot;Ohio&quot; .AddItem &quot;Pennsylvania&quot; .AddItem &quot;Wisconsin&quot; .ListIndex = 1 End With End Sub Private Sub UserForm_Initialize() use this if list is on worksheet Dim r As Range For Each r In Range(&quot;A1:A8&quot;) lbxStates.AddItem r.Value Next r lbxStates.ListIndex = 1 End Sub...
View Full Document

Page1 / 2

HW12_sol - Private Sub btnOK_Click() message =...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online