More Tricks with Graphic Objects

But wait, there’s more! We’ll describe a few features that are hard to classify with the other graphics features. You can essentially turn any graphic object into a button by assigning a macro to it. In addition, you can take pictures of your worksheets and use those pictures in Excel workbooks (or even in other programs); they can appear as static bitmaps or dynamic windows that display what is happening in other areas of the workbook or in other workbooks.

Assigning Macros to Objects

You can attach a macro to any object, which lets you activate the macro by clicking the object. To attach a macro to an object, do the following:

  1. Right-click the object, and click the Assign Macro command.

  2. When the Assign Macro dialog box appears (shown in Figure 10-51), assign a macro to the object by clicking New to create a new macro using the Visual Basic Editor, by clicking Record to create a new macro by example, or by selecting an existing macro from the list.

Note

For more information about macros, see Chapter 27.

Assigning macros to objects turns them into buttons.

Figure 10-51. Assigning macros to objects turns them into buttons.

Tip

INSIDE OUT Grouped Objects and Macros

Assigning macros to objects is a cool way to create some crazy-looking “buttons.” You can also assign macros to grouped objects or to individual objects that you subsequently group, but you can’t do both. For example, say you assign macros to two objects and then group the objects. You can click each object to run each macro, just as if they were ungrouped. But if you assign another macro to the grouped object, the new macro overrides the existing macros.

Creating Screenshots or Pictures of Your Worksheets

Excel provides several tools for taking pictures of your worksheets as well as other things on your computer screen. The Screenshot menu on the Insert tab allows you to capture almost anything on your computer screen. And you can use the Copy As Picture command or the Picture, Link, or Camera buttons to take pictures of your worksheets.

Taking Screenshots

image with no caption

The Screenshot menu on the Insert tab performs a function that usually requires a separate program for many people (including authors of software books!). With it, you can take a snapshot of anything and everything that appears on your computer screen, with one notable exception: Excel. Dedicated screen-capture programs typically hide themselves from view before you shoot the screen, and the built-in Screenshot feature behaves the same way. (If you want to take a picture of anything residing on a worksheet, see the following discussions of the Camera button and Paste Options.)

There are two ways to use the Screenshot feature; you can capture any full window with a single click, or you can drag to select a specific area of the screen to capture. Click the Screenshot button on the Insert tab to display the menu shown in Figure 10-52.

You can take snapshots of what’s on your screen.

Figure 10-52. You can take snapshots of what’s on your screen.

The Available Windows area of the Screenshot menu shows thumbnails of every window that is open on your computer, including applications, Web pages, and so on. If one of these windows is what you are after, simply click its thumbnail to immediately insert an image of it onto the active worksheet. If you instead click Screen Clipping, Excel minimizes itself and then you can drag to select any part of the screen you want. As soon as you are done selecting the area to shoot, the image is inserted onto the worksheet, as shown at the bottom of Figure 10-52. The inserted screenshot is considered a picture, and the Picture Tools Format tab appears when you select it.

Copying Cells as a Picture

image with no caption

The Copy As Picture command is located on the menu that appears when you click the little arrow next to the Copy button on the Home tab. It creates a graphic image of the selected area of the worksheet. After using the Copy As Picture command, you can paste what you copied into any Excel worksheet or into a document from any program that accepts Clipboard images. One reason to use this feature is to insert a worksheet image into another program that does not offer paste options. To avoid pasting an embedded link into the other program, use Copy As Picture to ensure that the image remains static.

Before clicking the Copy As Picture command, select the cells, object, or chart you want to copy. When you click the command, the dialog box in Figure 10-53 appears.

Use the Copy As Picture command to create static images of selected areas of your worksheets.

Figure 10-53. Use the Copy As Picture command to create static images of selected areas of your worksheets.

The options in the Copy Picture dialog box are as follows:

  • As Shown On Screen Reproduces the selection at the moment you take the picture.

  • As Shown When Printed Reproduces the selection according to the settings in the Page Setup dialog box that control the printing of gridlines and row and column headings.

  • Picture Copies the picture in a format that can be displayed on monitors with different resolutions. This is useful if the picture will be viewed on different computers.

  • Bitmap Copies the picture in a format that looks best when the display resolution is the same as the screen from which it was copied.

After you copy an image to the Clipboard, you can paste the image anywhere you want—into another location on the worksheet, another worksheet, or a document from another program.

Pasting Cells as a Picture

image with no caption

Where the Screenshot button allows you to take pictures of anything on your computer screen except Excel, there are two Paste options buttons that take pictures of nothing but Excel. The Paste menu on the Home tab offers two picture options. The Linked Picture button creates a linked image (essentially using the As Shown When Printed option instead of the As Shown On Screen option).

image with no caption

Figure 10-54 shows the Pacific Sales Summary worksheet on the left. We selected the range G3:G16, pressed Ctrl+C to copy, activated Book2, selected cell B4, and then clicked the Linked Picture button on the Home tab’s Paste menu. Excel inserts the picture of the worksheet cells as shown on the right in Figure 10-54.

Use the Linked Picture button to create dynamic images of selected areas of your worksheets.

Figure 10-54. Use the Linked Picture button to create dynamic images of selected areas of your worksheets.

The image is dynamically linked to the cells originally selected, not to their contents. As a result, the pasted image changes dynamically whenever the contents of the original cells change. This way, you can create “activity monitors” on a summary sheet, showing you the contents of remote cells in real time.

Note

Any graphic objects that happen to be within or overlapping the selected range also display in the linked picture.

When you select the linked picture, the formula bar displays a reference formula, as shown in Figure 10-54. After you create the picture, you can edit the formula and the picture changes accordingly. You can even change the references and link to a different worksheet or workbook. The link between the source and destination documents has another distinctive and useful characteristic. Suppose you close the Pacific Sales worksheet in Figure 10-54. If you then double-click the embedded image in Book1, Pacific Sales opens automatically, with the pictured range selected. You can use it in this way to quickly create “buttons” for opening supporting workbooks.

After you paste the linked picture, you can change its size and proportions by dragging its selection handles and treating it just like any other graphic object. Changes in shape, size, and formatting do not affect the dynamic updating of the data displayed in the picture.

image with no caption

The Picture button on the Home tab’s Paste menu does essentially the same thing as the Linked Picture button, minus the linking formula, so you can’t change it after you paste, and there is no connection to the source if you paste it into a different document.

Note

For more information about linking formulas, see Formula Fundamentals on page 467.

Creating Linked Images of Cells Using the Camera Button

image with no caption

The Camera button offers a slightly faster way of doing what the Linked Picture button does. With the Camera button, the cells are linked, pasted as shown on screen (rather than as shown when printed), and the image changes dynamically if the contents of the original cells change.

Note

The Camera button is not normally available on any tab or toolbar. You can add it to the ribbon if you create a custom group, but the quickest and easiest way to begin using the Camera button is to add it to the Quick Access Toolbar, as shown in Figure 10-55 on the next page. To do so, click the File tab, Options, Quick Access Toolbar. In the Choose Commands From drop-down list, select Commands Not In The Ribbon, select Camera in the list, and then click the Add button.

Add the Camera Button to the Quick Access Toolbar to quickly create dynamically linked worksheet images.

Figure 10-55. Add the Camera Button to the Quick Access Toolbar to quickly create dynamically linked worksheet images.

When using the Linked Picture button, you select the destination before you click; when using the Camera button, you select the destination after you click. If you select the same range (G3:G16) as we did in the Pacific Sales Summary worksheet shown in Figure 10-54, press Ctrl+C to copy, then click the Camera button, the pointer changes from a plus sign to crosshairs. Then just click where you want the upper-left corner of the picture to appear, and Excel embeds the picture just as shown on the right in Figure 10-54. The Camera button represents a one-less-click advantage over the equivalent procedure using the Linked Picture button, which may be significant if you have a lot of repetitive work to do.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset