Moving And Changing Text In Table.

S

Sam

Hi ...

Maybe I'm trying to do too much, or going about it the wrong way. Here's
what I'm attempting:

In a Word Table, one column has a name in it. I would like to leave the last
name in that column, and move the first name to the next column to the
right. While I'm at it, I want to change the name from all caps to `Proper.'

Table looks like this:

ADAMS, JOHN (Blank)
JONES, JERRY (Blank)
SMITH, MARY (Blank)

My goal is to have it end up like this:

Adams John
Jones Jerry
Smith Mary

Or is this a bit too ambitious??

Thank you,

Sam
--
A man who had lately declared
That property ought to be shared,
Thought it going too far
When they called for his car,
And a list of exceptions prepared.

Thomas Thorneley,
From The Penguin
Book Of Limericks
 
D

Doug Robbins - Word MVP - DELETE UPPERCASE CHARACT

Hi Sam,

The following will do it:

Dim i As Integer, Fname As String
For i = 1 To ActiveDocument.Tables(1).Rows.Count
Fname = Mid(ActiveDocument.Tables(1).Cell(i, 1).Range,
InStr(ActiveDocument.Tables(1).Cell(i, 1).Range, ",") + 2)
ActiveDocument.Tables(1).Cell(i, 2).Range = Fname
ActiveDocument.Tables(1).Cell(i, 1).Range =
Left(ActiveDocument.Tables(1).Cell(i, 1).Range,
InStr(ActiveDocument.Tables(1).Cell(i, 1).Range, ",") + -1)
Next i
ActiveDocument.Tables(1).Range.Case = wdTitleWord

Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested. Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.

Hope this helps
Doug Robbins - Word MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top