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 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75
| Public Sub Form()
'ouverture de l'application
Set appexcel = CreateObject("excel.application")
'ouverture du fichier "toto"
Set wbexcel = appexcel.Workbooks.Open("c:\MyDocs\toto.xls")
'ouverture de la feuille "tata"
Set wsexcel = wbexcel.Worksheets("tata")
insertion ligne apres la derniere ligne ecrite???????????????????????
i = 1
j = premiere cellule vide dans la colonne A????????????????????????
wsexcel.Cells(j, i).Value = Text4.Text
i = i + 1
wsexcel.Cells(j, i).Value = Text1.Text
i = i + 1
wsexcel.Cells(j, i).Value = Combo8.Text
i = i + 1
wsexcel.Cells(j, i).Value = Text2.Text
i = i + 1
wsexcel.Cells(j, i).Value = Text3.Text
i = i + 1
wsexcel.Cells(j, i).Value = Combo6.Text
i = i + 1
wsexcel.Cells(j, i).Value = Text5.Text
i = i + 1
wsexcel.Cells(j, i).Value = Combo1.Text
i = i + 1
wsexcel.Cells(j, i).Value = Combo2.Text
i = i + 1
wsexcel.Cells(j, i).Value = Combo7.Text
i = i + 1
wsexcel.Cells(j, i).Value = Combo3.Text
i = i + 1
wsexcel.Cells(j, i).Value = Text7.Text
i = i + 1
wsexcel.Cells(j, i).Value = Text8.Text
i = i + 1
wsexcel.Cells(j, i).Value = Combo4.Text
i = i + 1
wsexcel.Cells(j, i).Value = Text9.Text
i = i + 1
wsexcel.Cells(j, i).Value = Text10.Text
i = i + 1
wsexcel.Cells(j, i).Value = Text12.Text
i = i + 1
wsexcel.Cells(j, i).Value = Text13.Text
i = i + 1
wsexcel.Cells(j, i).Value = Text11.Text
i = i + 1
wsexcel.Cells(j, i).Value = Combo5.Text
i = i + 1
wsexcel.Cells(j, i).Value = Text14.Text
i = i + 1
wsexcel.Cells(j, i).Value = Text15.Text
i = i + 1
wsexcel.Cells(j, i).Value = Text16.Text
i = i + 1
wsexcel.Cells(j, i).Value = Text17.Text
i = i + 1
wsexcel.Cells(j, i).Value = Text18.Text
i = i + 1
wsexcel.Cells(j, i).Value = Text19.Text
i = i + 1
wbexcel.Close 'fermeture du classeur excel
appexcel.Quit 'fermeture de l'application excel
'desallocation memoire
Set wsexcel = Nothing
Set wbexcel = Nothing
Set appexcel = Nothing
End Sub |
Partager