Dick Kusleika - Excel Macros For Dummies
Здесь есть возможность читать онлайн «Dick Kusleika - Excel Macros For Dummies» — ознакомительный отрывок электронной книги совершенно бесплатно, а после прочтения отрывка купить полную версию. В некоторых случаях можно слушать аудио, скачать через торрент в формате fb2 и присутствует краткое содержание. Жанр: unrecognised, на английском языке. Описание произведения, (предисловие) а так же отзывы посетителей доступны на портале библиотеки ЛибКат.
- Название:Excel Macros For Dummies
- Автор:
- Жанр:
- Год:неизвестен
- ISBN:нет данных
- Рейтинг книги:4 / 5. Голосов: 1
-
Избранное:Добавить в избранное
- Отзывы:
-
Ваша оценка:
- 80
- 1
- 2
- 3
- 4
- 5
Excel Macros For Dummies: краткое содержание, описание и аннотация
Предлагаем к чтению аннотацию, описание, краткое содержание или предисловие (зависит от того, что написал сам автор книги «Excel Macros For Dummies»). Если вы не нашли необходимую информацию о книге — напишите в комментариях, мы постараемся отыскать её.
Excel Macros For Dummies
Excel Macros For Dummies
Excel Macros For Dummies — читать онлайн ознакомительный отрывок
Ниже представлен текст книги, разбитый по страницам. Система сохранения места последней прочитанной страницы, позволяет с удобством читать онлайн бесплатно книгу «Excel Macros For Dummies», без необходимости каждый раз заново искать на чём Вы остановились. Поставьте закладку, и сможете в любой момент перейти на страницу, на которой закончили чтение.
Интервал:
Закладка:
Trusted documents
Excel allows you to flag a document as trusted. Without getting into the technical minutia, a trusted document is essentially a workbook you have deemed safe by enabling macros.
If you open a workbook that contains macros, you see a yellow bar message under the Ribbon stating that macros (active content) have been disabled. If you have the Visual Basic Editor open, you'll get a dialog box instead of the yellow bar.
If you click Enable, the workbook automatically becomes a trusted document. This means you no longer are prompted to enable the content as long as you open that file on your computer. The basic idea is that if you told Excel that you “trust” a particular workbook by enabling macros, it is highly likely that you will enable macros each time you open it. Thus, Excel remembers that you’ve enabled macros before and inhibits any further messages about macros for that workbook.
This is great news for you and users of your macros. After enabling your macros just one time, they won’t be annoyed at the constant messages about macros, and you won't have to worry that your macro-enabled workbook will fall flat because macros have been disabled.
Trusted locations
If the thought of any macro message coming up (even one time) unnerves you, you can set up a trusted location for your files. A trusted location is a directory that is deemed a safe zone where only trusted workbooks are placed. A trusted location allows you and your clients to run a macro-enabled workbook with no security restrictions as long as the workbook is in that location.
To set up a trusted location, follow these steps:
1 Click the Macro Security button on the Developer tab.The Trust Center dialog box opens.
2 Click the Trusted Locations option on the left.This opens the Trusted Locations window (see Figure 1-6), which shows you all the directories that are considered trusted.
3 Click the Add New Location button.
4 Click Browse to find and specify the directory that will be considered a trusted location.
5 Add an optional description, click OK to close the Microsoft Office Trusted Location dialog, and then click OK again to close the Trust Center dialog.

FIGURE 1-6:The Trusted Locations window allows you to add directories that are considered trusted.
After you specify a trusted location, any Excel file opened from this location will have macros automatically enabled.
Storing and Running Macros
Macros are stored in a workbook. Even though you work with macros in the Visual Basic Editor, the code is stored in the same file with all the worksheets, cells, shapes, or whatever else you have inside your workbook. This makes macros very easy to distribute. You simply send someone the Excel file and the macros are included.
All macros need an event to start them running. Earlier in this chapter, I discussed assigning a shortcut key to a macro you record. Pressing the shortcut key is one type of event that can trigger a macro. In this section, I discuss the Personal Macro Workbook, a special workbook for storing macros, and a few common ways to trigger macros.
Storing macros in your Personal Macro Workbook
Most user-created macros are designed for use in a specific workbook, but you may want to use some macros in all your work. You can store these general-purpose macros in the Personal Macro Workbook so that they’re always available to you This file, named personal.xlsb, doesn't exist until you record a macro using Personal Macro Workbook as the destination. The Personal Macro Workbook is loaded whenever you start Excel.
To record the macro in your Personal Macro Workbook, select the Personal Macro Workbook option in the Record Macro dialog box before you start recording. This option is in the Store Macro In drop-down list (refer to Figure 1-1).
If you store macros in the Personal Macro Workbook, you don’t have to remember to open the Personal Macro Workbook when you load a workbook that uses macros. When you want to exit, Excel asks whether you want to save changes to the Personal Macro Workbook.
The Personal Macro Workbook normally is in a hidden window to keep it out of the way.
Assigning a macro to a button and other form controls
When you create macros, you may want to have a clear and easy way to run each macro. A basic button can provide a simple but effective user interface.
As luck would have it, Excel offers a set of form controls designed specifically for creating user interfaces directly on worksheets. There are several different types of form controls, from buttons (the most commonly used control) to scrollbars.
The idea behind using a form control is simple: You place a form control on a worksheet and then assign a macro to it — that is, a macro you’ve already recorded. When a macro is assigned to the control, that macro is executed, or played, when the control is clicked.
Take a moment to create a button for the AddTotalRelative macro you created earlier. Here’s how:
1 Click the Insert button on the Developer tab. (See Figure 1-7.)
2 Select the Button Form Control from the drop-down list that appears.
3 Click the location where you want to place your button.When you drop the button control onto your worksheet, the Assign Macro dialog box, shown in Figure 1-8, opens and asks you to assign a macro to this button.
4 Select the macro you want to assign to the button and then click OK.

FIGURE 1-7:You can find the form controls on the Developer tab.

FIGURE 1-8:Assign a macro to the newly added button.
FORM CONTROLS VERSUS ACTIVEX CONTROLS
The Insert command on the Developer tab shows both form controls and ActiveX controls (refer to Figure 1-7). Although they look similar, they’re quite different. Form controls are designed specifically for use on a worksheet, and ActiveX controls are typically used on Excel user forms (custom dialog boxes that are beyond the scope of this book). As a general rule, you should always use form controls when working on a worksheet unless there is a specific function that only ActiveX controls have. This is because form controls need less overhead, so they perform better, and configuring form controls is far easier than configuring their ActiveX counterparts.
At this point, you have a button that runs your macro when you click it! Keep in mind that all the controls in the Form Controls group (shown in Figure 1-7) can work in the same way as the command button, in that you assign a macro to run when the control is selected.
Placing a macro on the Quick Access Toolbar
You can also assign a macro to a button on the Quick Access Toolbar. The Quick Access Toolbar sits either above or below the Ribbon. You can add a custom button that runs your macro by following these steps:
1 Right-click your Quick Access Toolbar and select Customize Quick Access Toolbar.This opens the dialog box shown in Figure 1-9.
Читать дальшеИнтервал:
Закладка:
Похожие книги на «Excel Macros For Dummies»
Представляем Вашему вниманию похожие книги на «Excel Macros For Dummies» списком для выбора. Мы отобрали схожую по названию и смыслу литературу в надежде предоставить читателям больше вариантов отыскать новые, интересные, ещё непрочитанные произведения.
Обсуждение, отзывы о книге «Excel Macros For Dummies» и просто собственные мнения читателей. Оставьте ваши комментарии, напишите, что Вы думаете о произведении, его смысле или главных героях. Укажите что конкретно понравилось, а что нет, и почему Вы так считаете.