Читать книгу Excel 2019 Power Programming with VBA - Michael Alexander, Dick Kusleika - Страница 124
Let Excel help write your macro
ОглавлениеOne of the best places to get macro help is the macro recorder in Excel. When you record a macro with the macro recorder, Excel writes the underlying VBA for you. After recording, you can review the code, see what the recorder is doing, and then try to turn the code it creates into something more suited to your needs. For example, let's say you need a macro that refreshes all the pivot tables in your workbook and clears all of the filters in each pivot table. Writing this macro from a blank canvas would be a daunting task. Instead, you can start the macro recorder and record yourself refreshing all the pivot tables and clearing all the filters. Once you've stopped recording, you can review the macro and make any changes that you deem necessary.