Edit Faster with Free Macros
For example, the following macro attached to a commandbutton named 'Button1', will alternately manipulate the text and font color of the button with each click event. Sub Button1 ActiveSheet.Shapes('Button 1').Select. If Selection.Font.ColorIndex = 3 Then. Selection.Characters.Text = 'Gray' Selection.Font.ColorIndex = 15. The macro itself works correctly so I am assuming it is a problem with how I am writing the button. Any thoughts as to what I am doing wrong? The code below is what is in the UI Editor. Edit Macro Button In Excel Template On the Developer tab, in the Controls group, click Insert, and then under ActiveX Controls, click Command Button. Click the worksheet location at which you want the upper-left corner of the command button to appear. In the Controls group, click View Code. The second arrow highlights the Visual Basic and Macros buttons mentioned earlier. The visual basic button will simply open the VBA window and display code (also can use shortcut Alt + F11) but to display the code of the macro that was just recorded or to access all macros click on the Macros button. The new button has been added to the Tool Belt tab. It runs the macro called Add 3 Sheets when pressed. Here's how it looks on the ribbon: Adding Macro Buttons to the Quick Access Toolbar. The process for adding the macro button to the Quick Access Toolbar is essentially the same.
8 August, 2010
By Paul Beverley
The life of a professional editor is great: I sit in the comfort of my own home reading interesting books – and people pay me to do it! But some bits of the job are repetitious and tedious, and that's where macros come in: they do the boring bits and let me concentrate on engaging with the text. So, over the years, I have developed macros that help with a wide range of common tasks. And they're now available in a free downloadable book, Macros for Editors.
But Aren't Macros Really Complicated?
No. A macro is just a script that automates repeated tasks in Word documents. And you don't have to write macros to use macros. My book offers a range of over 400 macros written by editors for editors. To use them, you just have to learn how to load a macro into Word - and the book tells you how.
Just a Taste
Here are a few of the most widely-used macros from the book. Imagine...
- You're busy typing, and suddenly you realize that what you're typing is gobbling up the text ahead of it. Yes, you have accidentally hit the <Insert> key, and it is now in overtype mode. Bother! But this can be avoided by installing the OverTypeBeep macro.
- How many times a day do you add a 'that' to a sentence? Or change 'that' to 'which' or vice versa? One macro does it all – it adds 'that' if there isn't one or it switches between 'that' and 'which'. The same macro also automatically changes 'like' to 'such as', 'England' to 'the UK', 'as' to 'because', 'per cent' to '%', etc. Indeed, you can add whatever pairs of words you want it to switch.
- How often do you change a comma into a full stop and make the next word start with a capital, or do the reverse, or change it to a semi-colon or a colon? In each case, all you do is press Ctrl and Alt with the desired punctuation mark and let the macros sort out the case of the first letter of the following word.
- You're reading some text and you see a word or a phrase and think, 'How many times does this occur?' If you run CountPhrase, it will answer that question, doing both case-sensitive and case-insensitive counts.
- You have a book made up of chapters 1 to 10, and an appendix, all in separate files. Even if the client wants them kept in separate files, wouldn't it be helpful to have all the text in one file to make it easy to search for something? And if you're using PerfectIt, turning the text into one file massively increases the power of PerfectIt's consistency checking. One macro combines them for you. (And there's another that splits a big file up into chapters, if you need that.)
- Do you need to take all the pictures and diagrams out into a separate file, leaving behind call-outs: 'Figure 1 here' etc.? FigStrip does that. And if you have to do the same with tables, there's TableStrip.
- You see a word / phrase and you want to look back to the previous time it was used. Select it and, with one keypress, InstantFind will take you straight to the previous occurrence of that word / phrase. What's more, the word / phrase is now in the Find box, so by clicking Ctrl-PageUp and Ctrl-PageDown, you can jump through each and every occurrence in the text.
- You're reading the text and you see a number – '6', say – coming up and you need it to be 'six', so you click somewhere on the line and run the NumberToText macro, and it's instantly changed. Then the text says 'I've got 3 As, 2 Bs and 1 C' – so click, click, click (run the macro three times) and it becomes 'I've got three As, two Bs and one C'.
Excel Button To Run Macro
I hope these fire your imagination and encourage you to look at the rest of the macros. By picking the ones that best suit your way of working, you can save yourself a lot of time, and they will enable you to produce a more consistent output, especially in combination with PerfectIt.
Excel Add Button To Run Macro
Paul Beverley is an independent freelance editor who runs macro training sessions in the UK and overseas. His book, Macros for Editors, is available free of charge at www.archivepub.co.uk/TheBook.
Comments are closed.