Results 1 to 3 of 3

Thread: Word Tables

  1. #1
    mlrubin
    Guest

    Word Tables

    Need to be able to search to a blank cell in a table and input a character. It will be the same character every time. Already know find/replace won't work, as you can't search to nothing.

    Any ideas? Thanks in advance.<font face="Comic Sans MS">text</font face=comic>

  2. #2
    Star Lounger
    Join Date
    Dec 2000
    Posts
    70
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Word Tables

    Try this:

    Sub ReplaceEmptyCellsWithText()
    Dim aTable As Table
    Dim aCell As Cell

    For Each aTable In ActiveDocument.Tables
    For Each aCell In aTable.Range.Cells
    'Len of end-of-cell "character" is 2,
    'so if Len of cell is 2, it contains no text
    If Len(aCell.Range.Text) = 2 Then aCell.Range.Text = "New Text"
    Next aCell
    Next aTable
    End Sub

    Stephan

  3. #3
    Gold Lounger
    Join Date
    Dec 2000
    Location
    Hollywood (sorta), California, USA
    Posts
    2,759
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Word Tables

    Not that it matters in the grand scheme of things, but those two characters are:

    Chr(13) + Chr(7)

    This bit of almost completely useless knowledge has given me the chance to make another post to the forum.
    Kevin <IMG SRC=http://www.wopr.com/w3tuserpics/Kevin_sig.gif alt="Keep the change, ya filthy animal...">
    <img src=/w3timages/blackline.gif width=33% height=2><img src=/w3timages/redline.gif width=33% height=2><img src=/w3timages/blackline.gif width=33% height=2>

Posting Permissions

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