|
|
|
|
|
|
Word
|
Mark all empty cells in table
|
|
Ease of Use
|
Easy
|
Version tested with
|
2000, 2002, 2003
|
Submitted by:
|
MOS MASTER
|
Description:
|
If the selection is within a table then the sub will mark all empty cells in table.
|
Discussion:
|
You want a visual way to determine all empty cells are trully empty (No non-printing characters in them) The used method for checking the end of cell marker can come in use if one wants to test for a empty cell before filling it.
|
Code:
|
instructions for use
|
Option Explicit
Sub MarkEmptyCells()
Dim oCell As Word.Cell
With Selection
If .Information(wdWithInTable) Then
For Each oCell In .Tables(1).Range.Cells
If oCell.Range.Text = Chr(13) & Chr(7) Then
oCell.Shading.Texture = wdTextureSolid
End If
Next
End If
End With
End Sub
|
How to use:
|
- Open your Word document.
- Press Alt + F11 to open VBE.
- Insert-Module. (Insert -> module)
- Paste the code there in the window at right. (F7)
- Close VBE (Alt + Q or press the X in the top right hand corner).
- Save the file.
|
Test the code:
|
- Put the cursor in a table
- From Word, press Alt + F8 to open the macro dialog box.
- Select MarkEmptyCells
- Click Run.
|
Sample File:
|
Mark Empty Cells.zip 7.49KB
|
Approved by mdmackillop
|
This entry has been viewed 112 times.
|
|