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
|
Private Sub btn_chargerdonnees_Click()
Dim statistiques, s as String
Dim l As Integer
' ouvre le fichier statistiques
statistiques = "C:\Documents and Settings\aaa\Bureau\" & "Statistiques" & ".xls"
Workbooks.Open Filename:=statistiques
' compte le nombre de lignes a copier
Windows("Statistiques.xls").Activate
l = 2
s = Cells(2, 16).Value
Do
l = l + 1
s = Cells(l, 16).Value
Loop Until s = ""
' ferme le fichier statistiques
Windows("Statistiques.xls").Activate
ActiveWorkbook.Close
End Sub |
Partager