Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to group rows in Excel using VBA.
Excel
Rows("1:10").[1]
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'Outline' which is not a method.
Using 'Collapse' or 'Expand' which are actions, not methods.
✗ Incorrect
The Group method groups the specified rows or columns in Excel VBA.
2fill in blank
mediumComplete the code to collapse an outline level in Excel VBA.
Excel
ActiveSheet.Outline.ShowLevels RowLevels:=[1] Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 0 which hides all rows.
Using 2 or 3 which show more detailed levels.
✗ Incorrect
Setting RowLevels:=1 collapses the outline to show only the top level.
3fill in blank
hardFix the error in the code to ungroup columns in Excel VBA.
Excel
Columns("B:D").[1]
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'ClearOutline' which clears all outlines but is not a method of Columns.
Using 'RemoveGroup' which is not a valid method.
✗ Incorrect
The Ungroup method removes grouping from the specified columns.
4fill in blank
hardFill both blanks to group rows and then collapse the outline to level 2.
Excel
Rows("5:15").[1] ActiveSheet.Outline.ShowLevels RowLevels:=[2]
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'Ungroup' instead of 'Group' for the first blank.
Using 1 instead of 2 for the outline level.
✗ Incorrect
First, use Group to group rows 5 to 15. Then set RowLevels:=2 to collapse the outline to level 2.
5fill in blank
hardFill all three blanks to group columns, collapse to level 1, and then ungroup the columns.
Excel
Columns("C:F").[1] ActiveSheet.Outline.ShowLevels ColumnLevels:=[2] Columns("C:F").[3]
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'Ungroup' instead of 'Group' for the first blank.
Using 2 instead of 1 for the outline level.
Using 'Group' instead of 'Ungroup' for the last blank.
✗ Incorrect
Use Group to group columns C to F, set ColumnLevels:=1 to collapse to level 1, then Ungroup to remove the grouping.