Sunday, February 13, 2011

Macro: Repetitive Replacing of Table Cells


Here is today's time saver:

I had some tables (actually 1000 pages of tables!) where I needed to replace cells containing various text (denoted by comments from the SME) with a standard word (which was Reserved in this case). Normally, I would triple-click in the cell and then control-v to paste in the text (5 clicks/keys), but there were too many places that I needed to make this change.

Using the following macro this task was reduced to two clicks, once in the cell and then once on the button for the macro. There was one other requirement for this macro, which was that if the cell was in bold, it received slightly different text.

Sub makeCellReserved()
   Selection.SelectCell

   If Selection.Range.Bold = True Then
       Selection.Text = "RESERVED"
   Else
       Selection.Text = "Reserved"
   End If
End Sub

Wednesday, February 2, 2011

AIT: Highlighting Variants


This post describes how I use highlighting and release states in Author-It to make reviewing documents easier. This procedure assumes that you have a main book along with another book that uses variants of the objects in the main book. The variants are either variant topics or embedded variant topics. 
By using this procedure, the reviewer can review one complete document, and then just review the highlighted sections in the second document.

Setup
1. Open AIT Administrator
2. Select Security -> Release States
3. Add a new state:
a. Right click -> Add State
b. State name: HighlightVar
c. Right click over the new state, select Check Row
d. Click the box near the end of the row for HighlightVar / Review Color
e. Select yellow
f. Check that the boxes are checked for all relevant users

4. Do step 3 again to add the state DoNotHighlightVar, but skip steps d and e.
5. Close AIT Administrator
6. Open AIT
7. In your library, sort the objects by variant
8. Select (using Ctrl+click) all variants of the default object
9. Right mouse click, then select Change Release State -> HighlightVar

The variant of the main document can now be published with highlighted sections.

Sunday, January 30, 2011

Split Excel Columns into Multiple Rows

I am always forgetting how to do this, so today I am writing it down. When you have one long column of data in Excel and you want to split it into multiple rows of data (such as rows with 5 columns), how do you do it?

Assuming the data is in column A, then put into B1:

=Indirect(Address((Row(A1)-1)*5+Column(A1),1))

Copy to the right four times and then down as far as you need to. If you want to change the number of columns in the result, then change the '5' to the # of columns.

[Source OzGrid]

Sunday, January 23, 2011

Remove All BookMarks

Sometimes documents can get loaded with useless bookmarks. Here is a macro to remove them:

Sub RemoveAllBookmarks()
    Dim objBookmark As Bookmark

    For Each objBookmark In ActiveDocument.Bookmarks
        objBookmark.Delete
    Next
End Sub

Tuesday, January 18, 2011

Fontastic

Remember, it's not how you feel, but how you look.



Font selection chart: