- With ds.Tables("Employés")
- m = 10
- For i = 0 To .Rows.Count - 1
- k = CellDépart
- For j = 0 To .Columns.Count - 1
- If j = 0 Then
- Feuille.Cells(m, 1) = .Rows(i)(.Columns(j))
- ' Choix de la police
- Feuille.Cells(m, 1).Font.Name = "Arial Narrow"
- ' Taille de la police
- Feuille.Cells(m, 1).Font.Size = 11
- ' Caractères gras
- Feuille.Cells(m, 1).Font.Bold = True
- ' Couleur de fond (jaune clair)
- Feuille.Cells(m, 1).Interior.ColorIndex = 36
- End If
- If j = 1 Then
- Feuille.Cells(m, 7) = .Rows(i)(.Columns(j))
- Feuille.Cells(m, 7).Font.Bold = True
- m = m + 1
- End If
- If j > 1 Then
- Feuille.Cells(m, k) = .Rows(i)(.Columns(j))
- ' Alignement horizontal gauche, vertical centré
- Feuille.Cells(m, k).HorizontalAlignment = Excel.XlHAlign.xlHAlignLeft
- Feuille.Cells(m, k).VerticalAlignment = Excel.XlVAlign.xlVAlignCenter
- k = k + 1
- End If
- Next j
- ' Bordure inférieure des cellules (très fin)
- If i < .Rows.Count - 1 Then
- For k = 1 To 12
- With Feuille.Cells(m, k).Borders(Excel.XlBordersIndex.xlEdgeBottom)
- .Weight = Excel.XlBorderWeight.xlHairline
- End With
- Next
- End If
- k = CellDépart
- m = m + 1
- Next i
- ' Bordure inférieure des dernières cellules (fin)
- For k = 1 To 12
- With Feuille.Cells(m - 1, k).Borders(Excel.XlBordersIndex.xlEdgeBottom)
- .Weight = Excel.XlBorderWeight.xlThin
- End With
- Next
- End With
With ds.Tables("Employés")
m = 10
For i = 0 To .Rows.Count - 1
k = CellDépart
For j = 0 To .Columns.Count - 1
If j = 0 Then
Feuille.Cells(m, 1) = .Rows(i)(.Columns(j))
' Choix de la police
Feuille.Cells(m, 1).Font.Name = "Arial Narrow"
' Taille de la police
Feuille.Cells(m, 1).Font.Size = 11
' Caractères gras
Feuille.Cells(m, 1).Font.Bold = True
' Couleur de fond (jaune clair)
Feuille.Cells(m, 1).Interior.ColorIndex = 36
End If
If j = 1 Then
Feuille.Cells(m, 7) = .Rows(i)(.Columns(j))
Feuille.Cells(m, 7).Font.Bold = True
m = m + 1
End If
If j > 1 Then
Feuille.Cells(m, k) = .Rows(i)(.Columns(j))
' Alignement horizontal gauche, vertical centré
Feuille.Cells(m, k).HorizontalAlignment = Excel.XlHAlign.xlHAlignLeft
Feuille.Cells(m, k).VerticalAlignment = Excel.XlVAlign.xlVAlignCenter
k = k + 1
End If
Next j
' Bordure inférieure des cellules (très fin)
If i < .Rows.Count - 1 Then
For k = 1 To 12
With Feuille.Cells(m, k).Borders(Excel.XlBordersIndex.xlEdgeBottom)
.Weight = Excel.XlBorderWeight.xlHairline
End With
Next
End If
k = CellDépart
m = m + 1
Next i
' Bordure inférieure des dernières cellules (fin)
For k = 1 To 12
With Feuille.Cells(m - 1, k).Borders(Excel.XlBordersIndex.xlEdgeBottom)
.Weight = Excel.XlBorderWeight.xlThin
End With
Next
End With