View Single Post
  #1   Report Post  
Posted to microsoft.public.word.tables
Helmut Helmut is offline
external usenet poster
 
Posts: 7
Default cell number format

I have one table in a word document. In column 3 and 7 starting from row 2 I
want to change the input 10000 to 10,000.
I found the following:

Sub format()
'
Dim i As Long, mynum As Range
With ActiveDocument.Tables(1)
For i = 2 To .Rows.Count
Set mynum = .Cell(i, 3).Range
mynum.End = mynum.End - 1
.Cell(i, 3).Range = format(mynum, "#,##0")
Next i
End With

End Sub
--------------------------
It works fine for column 3, but when I change the 3 to 7 in a second sub, it
changes the values, but stops at:

Set mynum = .Cell(i, 7).Range

===========
Is there anyway I can do both columns in one macro?
what's the code?
thanks