Senin, 01 Juni 2009

Shortcut for Pasting Only Values

One of the most often-used commands in Excel is the Paste Special option from the Edit menu, where you can figure out exactly how you want information pasted into a worksheet. On the Paste Special dialog box, the Values selection is undoubtedly the one used the most. Since pasting only values in this manner is used so often, you might think that Microsoft would provide a shortcut key to, well, just paste values.

Unfortunately, they don't provide one. There are ways around this, however. One way is to just create a toolbar button that pastes values for you. All you need to do is follow these steps in versions of Excel prior to Excel 2007:

1.Choose Customize from the Tools menu. Excel displays the Customize dialog box.
2.Make sure the Commands tab is selected.
3.In the list of Categories, select the Edit category.
4.In the list of Commands, select Paste Values.
5.Use the mouse to drag the Paste Values command from the Commands list to its new location on the toolbar. When you release the mouse button, the new icon appears on the toolbar.
6.Click on Close to dismiss the Customize dialog box.
If you are using Excel 2007, you can add the command to the Quick Access toolbar by following these steps:

1.Click the Office button and then click Excel Options. Excel displays the Excel Options dialog box.
2.At the left side of the dialog box click Customize.
3.Use the Choose Commands From drop-down list to choose All Commands.
4.In the list of commands, choose Paste Values.
5.Click the Add button. The command is copied to the right side of the screen.
6.Click OK.
Now, whenever you want to paste just the values, you can click on the new toolbar button.

If you don't want to use the mouse to paste values, then you can use the tried-and-true keyboard sequence to paste values: Alt+E, S, V, Enter (for versions of Excel prior to Excel 2007) or Alt, H, V, S, V, Enter (for Excel 2007). This sequence selects the menus and dialog box options necessary to paste values.

If you want a shorter keyboard shortcut, the best way to do it is to create a macro that does the pasting for you, and then make sure that you assign a keyboard shortcut to the macro. For instance, create the following simple macro:

Sub PasteVal()
Selection.PasteSpecial Paste:=xlValues
End Sub
Now, follow these steps:

1.Press Alt+F8 to display the Macro dialog box.
2.From the list of available macros, select the PasteVal macro you just created.
3.Click on Options. Excel displays the Macro Options dialog box. (Click here to see a related figure.)
4.In the Shortcut Key area, indicate the key you want used with the Ctrl key as your shortcut. For instance, if you want Ctrl+G to execute the macro, then enter a G in the Shortcut Key area.
5.Click on OK to close the Macro Options dialog box.
6.Click on Cancel to close the Macro dialog box.
Now, whenever you want to paste values, all you need to do is press Ctrl+G, the macro will be run, and the values in the Clipboard will be pasted to the selected cell.