Presentation is loading. Please wait.

Presentation is loading. Please wait.

OV 3 - 1 Copyright © 2011 Element K Content LLC. All rights reserved.  Determine the Dialog Box Type  Capture User Input Creating an Interactive Worksheet.

Similar presentations


Presentation on theme: "OV 3 - 1 Copyright © 2011 Element K Content LLC. All rights reserved.  Determine the Dialog Box Type  Capture User Input Creating an Interactive Worksheet."— Presentation transcript:

1 OV 3 - 1 Copyright © 2011 Element K Content LLC. All rights reserved.  Determine the Dialog Box Type  Capture User Input Creating an Interactive Worksheet

2 OV 3 - 2 Copyright © 2011 Element K Content LLC. All rights reserved. Message Boxes Buttons for capturing users’ responses Buttons for capturing users’ responses Messages

3 OV 3 - 3 Copyright © 2011 Element K Content LLC. All rights reserved. Input Boxes Title bar text Message Buttons Default text

4 OV 3 - 4 Copyright © 2011 Element K Content LLC. All rights reserved. InputBox(Message, TitlebarTxt, DefaultTxt) The InputBox Function Default text Title bar text Message

5 OV 3 - 5 Copyright © 2011 Element K Content LLC. All rights reserved. Const CompanyName As String = “Our Global Company” Constants

6 OV 3 - 6 Copyright © 2011 Element K Content LLC. All rights reserved. The MsgBox Function MsgBox(Message, vbYesNo) Constant which determines the types of buttons Constant which determines the types of buttons Variable containing the message Variable containing the message

7 OV 3 - 7 Copyright © 2011 Element K Content LLC. All rights reserved. The Code Continuation Character Command runs off right margin Command runs off right margin Command broken on several lines Command broken on several lines Long command on one line of code Long command on one line of code Code continuation character used at the end of each line Code continuation character used at the end of each line

8 OV 3 - 8 Copyright © 2011 Element K Content LLC. All rights reserved. The vbCrLf Character Text displayed in the message box with line breaks Text displayed in the message box with line breaks Message = "Enter a number to sort by the following fields:" & vbCrLf & _ "1 –- By Date and Time" & vbCrLf & _ "2 -- By Customer Service Rep, Date, and Time" vbCrLf character used to indicate line breaks vbCrLf character used to indicate line breaks

9 OV 3 - 9 Copyright © 2011 Element K Content LLC. All rights reserved. Decision Structures Select Case UserResponse Case “1” MsgBox (Message1, vbYesNo) Case “2” MsgBox (Message2, vbYesNo) Case Else MsgBox (ErrMsg, vbYesNo) End Select Comparative data values Criterion variable If UserResponse = 2 Then MsgBox(Msg1, vbYesNo) EndIf Criterion expression Code that runs depending on the criteria Code that runs depending on the criteria Code blocks that perform different actions based on criteria Code blocks that perform different actions based on criteria

10 OV 3 - 10 Copyright © 2011 Element K Content LLC. All rights reserved. The Select Case Structure Select Case UserResponse Case “1” MsgBox (Message1, vbYesNo) Case “2” MsgBox (Message2, vbYesNo) Case Else MsgBox (ErrMsg, vbYesNo) End Select Beginning of the Select Case structure Beginning of the Select Case structure Comparative data values Criterion variable Code that runs depending on the value in criterion variable Code that runs depending on the value in criterion variable End of the Select Case structure End of the Select Case structure Case Else statement Case statements

11 OV 3 - 11 Copyright © 2011 Element K Content LLC. All rights reserved. The If Then Structure If UserResponse = 2 Then MsgBox(Msg1, vbYesNo) EndIf If Then statement Criterion expression End If statement Code to run if criterion met

12 OV 3 - 12 Copyright © 2011 Element K Content LLC. All rights reserved. 1. How can the use of input boxes and message boxes change the way you use Excel? Explain with examples. 2. Give examples of input that you may gather from a user to be used in a macro. Reflective Questions


Download ppt "OV 3 - 1 Copyright © 2011 Element K Content LLC. All rights reserved.  Determine the Dialog Box Type  Capture User Input Creating an Interactive Worksheet."

Similar presentations


Ads by Google