Current Region

Basic Exercise


Add a button to a worksheet and assign it to a macro the selects the current region. If any data are missing complete them with the value directly above.

Suggested Concepts:

Note: the function If Else was applied to the solution of the exercise only to avoid an error to occur. This happens when the macro treats the exercise statement as part of the CurrentRegion. Note that to overcome this error the Intersect method was applied as shown in the previous exercise Intersection.

Remember that in most cases there is more than one way to solve the exercise.

Hint: Use FormulaR1C1 reference style to reference blank cells.

Show Answer

Download exercise Download answer is learning website. Examples might be simplified to improve reading and basic understanding. Tutorials, references, and examples are constantly reviewed to avoid errors, but we cannot warrant full correctness of all content. All Rights Reserved.

Excel ® is a registered trademark of the Microsoft Corporation.

© 2023 SuperExcelVBA | ABOUT

Protected by Copyscape