Insert Quotation Marks

N

ng6971

Hi All,

I have a table of multiple columns. Just want to add "xxx" quotation marks
at the begining and at the end of each cell in the whole table where text
appears. Notice that there has been some blank cells also in the table.

Thanks in advance.

NG
 
D

Doug Robbins - Word MVP

Use:

Dim i As Long, j As Long
Dim rng As Range
With ActiveDocument.Tables(1)
For i = 1 To .Rows.Count
For j = 1 To .Columns.Count
Set rng = .Cell(i, j).Range
rng.End = rng.End - 1
If Len(rng.Text) > 0 Then
rng.Text = Chr(34) & rng.Text & Chr(34)
End If
Next j
Next i
End With


--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP, originally posted via msnews.microsoft.com
 
Top