Online Exam Quiz

questionQuestion  1 to 30

What is the purpose of the With statement in VBA?

  • To simplify code by grouping statements
  • To define new variables
  • To create a new worksheet
  • To execute a function
Mark for review

How do you declare a global variable in VBA?

  • Global
  • DeclareGlobal
  • Public
  • GlobalVar
Mark for review

How do you loop through each worksheet in a workbook using VBA?

  • For Each ws In Worksheets
  • For ws = Worksheets
  • For ws In Sheets
  • For Each ws In Sheets
Mark for review

What does the keyword "Option Explicit" do in VBA?

  • Enables case sensitivity
  • Forces declaration of all variables
  • Disables debugging
  • Hides errors
Mark for review

Which method is used to insert a column in a worksheet in VBA?

  • InsertColumn()
  • AddColumn()
  • Insert()
  • Columns.Insert()
Mark for review

How do you refer to the active worksheet in VBA?

  • ActiveSheet()
  • CurrentSheet()
  • ThisSheet()
  • Worksheet()
Mark for review

Which method is used to delete a worksheet in VBA?

  • DeleteSheet()
  • RemoveSheet()
  • Delete()
  • Remove()
Mark for review

What does the For Each loop iterate through?

  • Elements of a collection
  • Numbers in a range
  • Characters in a string
  • Worksheets in a workbook
Mark for review

How do you clear the contents of a cell in VBA?

  • ClearCell()
  • DeleteCell()
  • ClearContents()
  • RemoveCell()
Mark for review

How do you set the font size of a cell to 12 in VBA?

  • Range("A1").Font.Size = 12
  • Range("A1").Font.Size = 12
  • Range("A1").Font.Size = "12"
  • Range("A1").Font.Size = "12"
Mark for review

Which function is used to display an input box in VBA?

  • InputBox
  • MsgBox
  • PromptBox
  • TextBox
Mark for review

How do you declare a dynamic array in VBA?

  • dim arr()
  • array arr()
  • arr = array()
  • dynamic arr()
Mark for review

What is the default access level for a module in VBA?

  • Public
  • Private
  • Protected
  • Static
Mark for review

What keyword is used to exit a loop in VBA?

  • Break
  • Exit
  • End
  • Stop
Mark for review

How do you insert a new module in the VBA editor?

  • Insert > Module
  • File > New Module
  • Home > New Module
  • Developer > New Module
Mark for review

How can you delete a row in VBA?

  • Rows(RowNumber).Delete
  • Range("RowNumber").Delete
  • Worksheet.Rows(RowNumber).Clear
  • Sheets("Sheet1").Rows(RowNumber).Delete
Mark for review

Which method is used to save a workbook in VBA?

  • Save()
  • SaveAs()
  • SaveWorkbook()
  • Export()
Mark for review

What does VBA stand for?

  • Visual Basic Analysis
  • Visual Basic Analysis
  • Visual Basic for Applications
  • Visual Basic for Applications
Mark for review

Which data type is used to store textual data in VBA?

  • Integer
  • Double
  • String
  • Boolean
Mark for review

Which method is used to display a message box in VBA?

  • ShowMessageBox
  • MsgBox
  • DisplayMsg
  • Alert
Mark for review

What is the purpose of the "Exit Sub" statement in VBA?

  • Exit the current loop
  • Exit the current function
  • Exit the current subroutine
  • Exit the entire program
Mark for review

How do you check if a worksheet exists in VBA?

  • WorksheetExists()
  • SheetExists()
  • CheckWorksheet()
  • DoesSheetExist()
Mark for review

How can you create a new workbook using VBA?

  • Workbooks.Add
  • New Workbook
  • CreateWorkbook
  • AddWorkbook
Mark for review

Which method is used to close a workbook in VBA?

  • Close()
  • CloseWorkbook()
  • SaveAndClose()
  • Quit()
Mark for review

Which statement is used to declare a variable in VBA?

  • var
  • dim
  • declare
  • variable
Mark for review

What is the file extension for Excel macro-enabled workbooks?

  • .xlsx
  • .xlsm
  • .xls
  • .vba
Mark for review

How do you add a border to a cell in VBA?

  • Range("A1").Borders.LineStyle = xlContinuous
  • Range("A1").Border = xlContinuous
  • Range("A1").Borders.Style = xlContinuous
  • Range("A1").Borders.Add
Mark for review

What does the "DoEvents" function do in VBA?

  • Pause execution and wait for user input
  • Allow other events to be processed
  • Stop execution of the current subroutine
  • Display an error message
Mark for review

Which statement is used to start a comment in VBA?

  • //
  • /*
  • '
  • #
Mark for review

Which function is used to convert a string to a date in VBA?

  • ConvertToDate()
  • DateFromString()
  • DateValue()
  • StringToDate()
Mark for review

blinkerOnline

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • Answered
  • Not Answered
  • Marked for Review