MO-211 practice question 25 of 35
What is the purpose of the Selection object in VBA?
Full set: 355 questionsDomain Insert and format text, shapes, and images
The Selection object is a property of the Application object that returns the currently selected object in the active window. In an Excel worksheet, this is most commonly a Range object representing one or more cells. The primary purpose of the Selection object is to provide a programmatic way for VBA code to refer to and manipulate the cells, chart, or shape that a user has currently selected on the screen. While the wording of option C is an action ("To select"), it correctly identifies the core concept associated with the object: the selected range of cells.
A. The ActiveCell property, not the Selection object, is used to specifically refer to the single active cell within the current selection.
B. Highlighting is a formatting action (e.g., changing Interior.Color) that can be applied to the Selection object, but it is not the object's fundamental purpose.
D. Creating a new workbook is performed using the Workbooks.Add method, which is unrelated to the Selection object or any user selection on a worksheet.
1. Microsoft Corporation. (2023). Application.Selection Property (Excel). Microsoft Learn | Office VBA Reference. Retrieved from https://learn.microsoft.com/en-us/office/vba/api/excel.application.selection.
Reference Detail: The documentation states
"Returns the object that is currently selected in the active window." For a worksheet
it clarifies that the returned object type can be a Range
Chart
Shape
etc.
with Range being the most common. This supports that the object's purpose is to represent the selected range.
2. University of Reading. (n.d.). An Introduction to Visual Basic for Applications in Excel. Statistical Services Centre
p. 19.
Reference Detail: In the section on "Objects
Properties and Methods
" the document explains
"The current selection is itself an object
called Selection. So Selection.Font.Bold = True makes the current selection bold." This demonstrates that the Selection object's purpose is to represent the currently selected cells for manipulation.
Keep practicing
Take the free MO-211 practice test
Ten exam-style questions with answers and explanations, plus the exam facts and study guides.
More questions
Other MO-211 practice questions
- Question 1What formula can be used to calculate the sum of a range of cells in Excel?
- Question 2Which chart type is best used to display trends over time?
- Question 3What is the formula used in Excel to calculate the percentage change between two numbers?
- Question 4What is a slicer in Excel?
- Question 5What is the shortcut key to insert a new worksheet in Excel?
- Question 6What is the shortcut key for copying a formula in Excel?
