Dick Kusleika - Excel Macros For Dummies

Здесь есть возможность читать онлайн «Dick Kusleika - Excel Macros For Dummies» — ознакомительный отрывок электронной книги совершенно бесплатно, а после прочтения отрывка купить полную версию. В некоторых случаях можно слушать аудио, скачать через торрент в формате fb2 и присутствует краткое содержание. Жанр: unrecognised, на английском языке. Описание произведения, (предисловие) а так же отзывы посетителей доступны на портале библиотеки ЛибКат.

Excel Macros For Dummies: краткое содержание, описание и аннотация

Предлагаем к чтению аннотацию, описание, краткое содержание или предисловие (зависит от того, что написал сам автор книги «Excel Macros For Dummies»). Если вы не нашли необходимую информацию о книге — напишите в комментариях, мы постараемся отыскать её.

Save time and become an Excel wizard with the world’s leading Excel macro guide
Excel Macros For Dummies
Excel Macros For Dummies

Excel Macros For Dummies — читать онлайн ознакомительный отрывок

Ниже представлен текст книги, разбитый по страницам. Система сохранения места последней прочитанной страницы, позволяет с удобством читать онлайн бесплатно книгу «Excel Macros For Dummies», без необходимости каждый раз заново искать на чём Вы остановились. Поставьте закладку, и сможете в любой момент перейти на страницу, на которой закончили чтение.

Тёмная тема
Сбросить

Интервал:

Закладка:

Сделать

2 Select Macros from the Choose Commands From drop-down list on the left.

3 Select the macro you want to add and click the Add button.

4 (Optional) Click the Modify button to change the icon or display name, and then click OK to close the Modify Button dialog box.

5 Click OK to close the Excel Options dialog box.

FIGURE 19Adding a macro to the Quick Access Toolbar Exploring Macro - фото 21

FIGURE 1-9:Adding a macro to the Quick Access Toolbar.

Exploring Macro Examples

Covering the fundamentals of building and using macros is one thing. Coming up with good ways to incorporate them into your reporting processes is another. Take a moment to review a few examples of how macros automate simple reporting tasks.

Excel Macros For Dummies - изображение 22Open Chapter 1 Samples.xlsm to follow along in the next section.

Building navigation buttons

One common use of macros is navigation. Workbooks that have many worksheets or tabs can be frustrating to navigate. To help your users, you can create some sort of a switchboard, similar to the one shown in Figure 1-10. When a user clicks the Example 1 button, he’s taken to the Example 1 sheet.

Creating a macro to navigate to a sheet is quite simple.

1 Start at the sheet that will become your switchboard or starting point.

2 Start recording a macro.

3 While recording, click the destination sheet (the sheet this macro will navigate to).

4 After you click in the destination sheet, stop recording the macro.

5 Assign the macro to a button.

Excel Macros For Dummies - изображение 23

FIGURE 1-10:Use macros to build buttons that help users navigate your reports.

Excel Macros For Dummies - изображение 24It’s useful to know that Excel has a built-in hyperlink feature, allowing you to convert the contents of a cell into a hyperlink that links to another location. That location can be a separate Excel workbook, a website, or even another tab in the current workbook. Although using a hyperlink may be easier than setting up a macro, you can’t apply a hyperlink to form controls (such as buttons). Instead of a button, you’d use text to let users know where they’ll go when they click the link.

Dynamically rearranging PivotTable data

Macros can be used with any Excel object normally used in reporting. For instance, you can use a macro to give your users a way to dynamically change aPivotTable. In the example shown in Figure 1-11, macros allow a user to change the perspective of the chart simply by clicking any one of the buttons.

Figure 1-12 reveals that the chart is actually a PivotChart tied to a PivotTable. The recorded macros assigned to each button are doing nothing more than rearranging the PivotTable to slice the data using various pivot fields.

FIGURE 111This report allows users to choose their perspective FIGURE - фото 25

FIGURE 1-11:This report allows users to choose their perspective.

FIGURE 112The macros behind these buttons rearrange the data fields in a - фото 26

FIGURE 1-12:The macros behind these buttons rearrange the data fields in a PivotTable.

Here are the high-level steps needed to create this type of setup:

1 Create your PivotTable and PivotChart.

2 Start recording a macro.

3 While recording, move a pivot field from one area of the PivotTable to the other. When you’re done, stop recording the macro.

4 Record another macro to move the data field back to its original position.

5 After both macros are set up, assign each one to a separate button.

You can run your new macros in turn to see your pivot field dynamically move back and forth.

Offering one-touch reporting options

The last two examples demonstrate that you can record any action that you find of value. That is, if you think users would appreciate a certain feature being automated for them, why not record a macro to do so?

In Figure 1-13, buttons are tied to macros that filter the PivotTable for the top or bottom 20 customers. Because the steps to filter a PivotTable for the top and bottom 20 have been recorded, users can get the benefit of this functionality without knowing how to do it themselves. Also, recording a specific action allows you to manage risk a bit. That is to say, your users can interact with your reports in a method that has been developed and tested by you.

FIGURE 113Offering prerecorded views not only saves time and effort but it - фото 27

FIGURE 1-13:Offering prerecorded views not only saves time and effort, but it also allows users that don’t know how to use advanced features to benefit from them.

This not only saves them time and effort, but it also allows users that don’t know how to take these actions to benefit from them.

Figure 1-14 demonstrates how you can give your audience a quick and easy way to see the same data on different charts. It’s not uncommon to be asked to see the same data different ways. Instead of taking up real estate by showing both charts, just record a macro that changes the Chart Type of the chart. Your clients can switch views to their heart’s content.

FIGURE 114You can give your audience a choice in how they view data Chapter - фото 28

FIGURE 1-14:You can give your audience a choice in how they view data.

Chapter 2

Getting Cozy with the Visual Basic Editor

IN THIS CHAPTER

картинка 29 Understanding the Visual Basic Editor components

картинка 30 Working with the Project Explorer

картинка 31 Using a Code pane

картинка 32 Customizing the Visual Basic Editor

The Visual Basic Editor (VBE) is the environment where all Excel macros are written or recorded. The VBE is included with Excel free of charge. Even if you never record one macro, the VBE is in the background waiting to be used. When you create a macro, the VBE quietly comes to life ready to process the various procedures and routines you give it.

In this chapter, you take your first look behind the curtain to explore the VBE.

Working in the Visual Basic Editor

The VBE is actually a separate application that runs when you open Excel. To see this hidden VBE environment, you need to activate it. With Excel open, one of these two ways does the trick:

Читать дальше
Тёмная тема
Сбросить

Интервал:

Закладка:

Сделать

Похожие книги на «Excel Macros For Dummies»

Представляем Вашему вниманию похожие книги на «Excel Macros For Dummies» списком для выбора. Мы отобрали схожую по названию и смыслу литературу в надежде предоставить читателям больше вариантов отыскать новые, интересные, ещё непрочитанные произведения.


Отзывы о книге «Excel Macros For Dummies»

Обсуждение, отзывы о книге «Excel Macros For Dummies» и просто собственные мнения читателей. Оставьте ваши комментарии, напишите, что Вы думаете о произведении, его смысле или главных героях. Укажите что конкретно понравилось, а что нет, и почему Вы так считаете.

x