View Single Post
  #8  
Old January 30th, 2010, 12:01 AM posted to microsoft.public.word.tables
Transcribe
external usenet poster
 
Posts: 5
Default Dividing one column into two in a six-column table

Hello, again, Macropod,

Thank you so much for taking the time to write this macro. You say this
macro will move any text between square brackets in the second column to the
third column...and that's exactly what I need to do! I have read Help for
"Create a macro" and for "Run a macro," and I am having no luck making it
work. I'm unfamiliar with macros (having had my measly two MS Word classes
about 15 years ago). When I attempt to "run" the macro, it just puts the text
of the macro in my document. Yikes! It may take you too much time to lead me
through the steps to create and utilize this macro, as that may not be within
the scope of this discussion group.

Transcribe

"macropod" wrote:

Hi Transcribe,

Yes the column would be blank. If you've only got a few maiden names to process, it wouldn't take much effort to transfer them
manually. If you got many to process, you could use the following macro:

Sub Move_Maidens()
Dim oCel As Cell
Application.ScreenUpdating = False
With Selection
If Not .Information(wdWithInTable) Then Exit Sub
For Each oCel In .Tables(1).Columns(2).Cells
With oCel.Range.Find
.ClearFormatting
.Replacement.ClearFormatting
.Text = "\[[!\[\]]{1,}\]"
.Forward = True
.Wrap = wdFindStop
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
.Execute
If .Found = True Then
oCel.Next.Range.Text = .Parent.Text
.Parent.Delete
End If
End With
Next
End With
Application.ScreenUpdating = True
End Sub

Note that this macro will move any text between square brackets in the second column to the third column.

--
Cheers
macropod
[Microsoft MVP - Word]