Results 1 to 3 of 3
  1. #1
    5 Star Lounger
    Join Date
    Mar 2001
    Location
    New York, NY
    Posts
    922
    Thanks
    2
    Thanked 12 Times in 11 Posts

    Column / Range (Word XP)

    I need to clean up some formatting in columns 4 and 5 of a Word table. (Phone number with inconsistent dots, dashes and parens.) I have written a macro that uses Range.Find.Execute with a replacement value. This works well... too well. Since columns don't have a range property, I set the range for the column by first selecting the column and then Set rng = Selection.Range.

    Sometimes, not always, the Find/Replace also affects other columns in the table. Is there a more precise way to set a range for the specific columns involved so that Fine/Replce is better contained within the specific column?

    Thanks,
    Richard Barrett

  2. #2
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Column / Range (Word XP)

    <P ID="edit" class=small>(Edited by jscher2000 on 22-Oct-06 10:11. Added cross-references.)</P>Ordinary Word ranges run left-to-right, so they cannot be limited to a single column of a table without including the intervening cells. Your choice of a selection is the best way to get at just the cells in a single column without looping (i.e., running the search for each individual cell at a particular row and column). If your table has merged cells, well...

    Added: The link provided by HansV in an earlier thread of similar name (Column / Range (Word 2002)) may shed more light on this.

  3. #3
    5 Star Lounger
    Join Date
    Mar 2001
    Location
    New York, NY
    Posts
    922
    Thanks
    2
    Thanked 12 Times in 11 Posts

    Re: Column / Range (Word XP)

    No merged cells, but I do realize the best way is to iterate through the rows, defning a range for the cell/column that I need. There doesn't seen to be a loss of speed, and it's definitely more precise.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •