user_mobilelogo

Public Sub Tableau()
'macro écrite par Anacoluthe
On Error Resume Next
Dim oTable As Table
Dim oRow As Row
For Each oTable In ActiveDocument.Tables
For Each oRow In oTable.Rows
If LigneVide(oRow) Then
oTable.Rows(oRow.Index + 1).Cells(1).Range.Style = "Titre 2"
End If
Next oRow
Next oTable
End Sub



Public Function LigneVide(Rang As Row) As Boolean
' Teste si une ligne d’un tableau est vide
Dim oCell As Cell
LigneVide = True
For Each oCell In Rang.Cells
If Len(oCell.Range.Text) <> 2 Then
LigneVide = False
Exit For
End If
Next oCell
End Function

 

nb : une cellule vide de tableau est en réalité composée d'un retour paragraphe Chr(13) et d'une sorte d'espace Chr(7), donc de deux caractères.

Statistiques

Aujourd'hui6
Hier1867
Cette semaine8942
Ce mois28235
Total depuis 200418230775

3
visiteurs actuellement en ligne

20 avril 2024