Hardware Reference
In-Depth Information
5. Your final macro should look like this:
Sub PastePlainText()
'
' PTT Macro
'
'
Selection.PasteSpecial Link:=False, _
DataType:=wdPasteText, Placement:=wdInLine, _
DisplayAsIcon:=False
End Sub
6. If you like, you can remove the lines starting with an apostrophe; those are
comment lines that don't affect the macro's function.
Your macro is now ready to run. You can run it using Tools > Macro > Macros, assign a
keyboard shortcut to your macro (such as Command-Shift-V) following the instructions in
Assign a Keyboard Shortcut to a VBA Macro , or put it on a menu (see Add a VBA Macro to a
Menu ).
Note: I said I “wrote” this macro years ago, but, in fact, I cheated—I recorded myself
following the steps I spelled out a moment ago, and this macro is what I got!
Find Sample VBA Macros
You should be able to turn up all sorts of VBA macros with a few Web searches. Here are a
few resources to get you started:
Excel Macro Examples & Free Downloads at Chandoo.org
VBA Code Excel Examples at Analysistabs
Word: Sample Macros, VBA Codes at MSDN Blogs
Learn More about VBA
To get help writing and editing VBA macros, try these sites:
• The Office 2011 for Mac Create, run, edit, or delete a macro page
• The Office 2011 for Mac Getting Started with VBA in Office for Mac 2011 page
Search WWH ::




Custom Search