Doe er eens een voorbeeldje bij, dat scheelt ons weer tijd. Met uiteraard de macro's.
Dit is wat ik tot zover heb.
Selection.HomeKey wdStory
ActiveWindow.View.ShowFieldCodes = False
ActiveDocument.Bookmarks("Bm_1").Range.Fields(1).Unlink
Selection.GoTo What:=wdGoToBookmark, Name:="Bm_1"
Selection.ConvertToTable Separator:=wdSeparateByTabs, NumColumns:=5, _
NumRows:=3, AutoFitBehavior:=wdAutoFitContent
'hier voeg ik de eerste kolom toe
Selection.MoveRight Unit:=wdCell
Selection.MoveRight Unit:=wdCell
Selection.SelectColumn
Selection.InsertColumnsRight
'Hier voeg ik de 2e kolom toe
Selection.MoveRight Unit:=wdCell
Selection.MoveRight Unit:=wdCell
Selection.SelectColumn
Selection.InsertColumnsRight
'Hier gaat het fout en is dus mijn vraag
For i = Selection.Tables(1).Rows.Count To 1 Step -1
If Len(Selection.Tables(1).Cell(i, 2).Range.Text) <= 2 Then
Selection.TypeText Text:="€"
End If
Next i
With Selection.Tables(1)
.Style = "Tabelraster"
.ApplyStyleHeadingRows = True
.ApplyStyleLastRow = False
.ApplyStyleFirstColumn = True
.ApplyStyleLastColumn = False
.Columns(1).Width = CentimetersToPoints(3)
.Columns(2).Width = CentimetersToPoints(3)
.Columns(3).Width = CentimetersToPoints(0.6)
.Columns(4).Width = CentimetersToPoints(3)
.Columns(5).Width = CentimetersToPoints(0.6)
.Columns(6).Width = CentimetersToPoints(3)
End With
'Hier laat ik de lege rijen verwijderen
For i = Selection.Tables(1).Rows.Count To 1 Step -1
If Len(Selection.Tables(1).Cell(i, 4).Range.Text) <= 2 Then
Selection.Tables(1).Rows(i).Delete
End If
Next i