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
   | Do While Not rstTemp.EOF
'Ecriture de l'origine
'rstTemp.MoveNext
 
j = ligne_debut
 
'Boucle qui regarde si c'est la première fourniture de ce type pour ce pays ou non
Do While rstTemp.Fields(2).Value <> xlSheet.Cells(j, 4) And j < i
j = j + 1
Loop
 
 
'Si c'est la première alors j = i, et on insère les informations de ligne
    If j = i Then
  If a_pays <> rstTemp.Fields(16).Value Then
    xlSheet.Cells(i, 1) = rstTemp.Fields(16).Value
    a_pays = rstTemp.Fields(16).Value
    End If
 
    xlSheet.Cells(i, 2) = rstTemp.Fields(17).Value
    xlSheet.Cells(i, 3) = rstTemp.Fields(1).Value
 
    xlSheet.Cells(j, 4) = rstTemp.Fields(2).Value 'Fourniture
    xlSheet.Cells(j, 5) = rstTemp.Fields(3).Value ' Nature
    xlSheet.Cells(j, 6) = rstTemp.Fields(7).Value ' Scénario
 
     i = i + 1
 
For k = 1 To 79
     xlSheet.Cells(i - 1, k).Borders(xlEdgeRight).LineStyle = xlContinuous
    xlSheet.Cells(i - 1, k).Borders(xlEdgeRight).Weight = xlThin
Next
 
     End If
 
rstTemp.MoveNext
Loop | 
Partager