1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
| Sub TaRoutine()
'... début à compléter
Set wtable = Rng.Tables(1)
Dim LineSE As Integer: LineSE = GetLineInTableCol(wtable, 1, "Systeme d'exploitation")
Dim LineBD As Integer: LineBD = GetLineInTableCol(wtable, 1, "Base de donnée")
Dim LineWasSrv As Integer: LineWasSrv = GetLineInTableCol(wtable, 1, "Was Server")
Dim LineMdWr As Integer: LineMdWr = GetLineInTableCol(wtable, 1, "Middlware")
' Je veux placer ce test la
'Si ya toute les lignes
If LineSE > 0 And LineBD > 0 And LineWasSrv > 0 And LineMdWr > 0 Then
'Je fis action Z
End If
'Si Ya pas que la Ligne 1 : Systeme d'exploitation
If LineSE < 0 And LineBD > 0 And LineWasSrv > 0 And LineMdWr > 0 Then
'Je fais une actio)n A
'Sinon Si Ligne : Base de donnée
ElseIf LineSE > 0 And LineBD < 0 And LineWasSrv > 0 And LineMdWr > 0 Then
'Je fais l'action B
End If
End Sub
Function GetLineInTableCol(tb As Word.Table, col As Integer, lineValue As String) As Integer
Dim ri As Integer
GetLineInTableCol = -1
For ri = 1 To tb.Rows.Count
If InStr(1, tb.Cell(ri, col).Range, lineValue) > 0 Then
GetLineInTableCol = ri
Exit For
End If
Next ri
End Function |
Partager