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
|
Private Sub cmdRésultat_Click()
Dim MonXl As Excel.Application
Set MonXl = CreateObject("Excel.Application") ' Ceci initialise la variable et charge Excel en arrière plan
MonXl.Visible = True 'Rend Excel visible...
MonXl.UserControl = True
' Ouvre MonFichier
MonXl.Workbooks.Open FileName:="C:\r1.xls"
Dim En_Colone, En_Ligne
Application.ScreenUpdating = False
Range("A1").Value = "nom :"
Range("b1").Value = "âge :"
Range("c1").Value = "année étude :"
Range("d1").Value = "salaire :"
Range("e1").Value = "exp prof :"
Range("f1").Value = "exp étranger :"
Range("g1").Value = "note Critère 1"
Range("h1").Value = "note Critère 2"
Range("i1").Value = "note Citère 3"
Range("j1").Value = "note Citère 4"
Range("k1").Value = "note Citère 5"
Range("l1").Value = "moyenne"
Range("A1").Select
En_Colone = ActiveCell.Column
En_Ligne = ActiveCell.Row + 1
While Not IsEmpty(ActiveCell.Value)
Cells(En_Ligne, En_Colone).Activate
En_Ligne = En_Ligne + 1
Wend
ActiveCell.Offset(0, 0).Range("A1").Select
ActiveCell.Value = Form1.Text1
ActiveCell.Offset(0, 1).Range("A1").Select
ActiveCell.Value = Form1.Text2
ActiveCell.Offset(0, 1).Range("A1").Select
ActiveCell.Value = Form1.Text3
ActiveCell.Offset(0, 1).Range("A1").Select
ActiveCell.Value = Form1.Text4
ActiveCell.Offset(0, 1).Range("A1").Select
ActiveCell.Value = Form1.Text5
ActiveCell.Offset(0, 1).Range("A1").Select
ActiveCell.Value = Form1.Text6
Application.ScreenUpdating = True
ActiveWorkbook.SaveAs "C:\r1.xls"
Workbooks.Close
MonXl.Quit
Set MonXl = Nothing
End Sub
Private Sub cmdsuivant_Click()
Dim obj As Object
For Each obj In Me.Controls
If TypeName(obj) = "TextBox" Then
obj.Text = ""
End If
Next
Text1.SetFocus
Dim opt As Object
For Each opt In Me.Controls
If TypeName(opt) = "OptionButton" Then
opt.Value = False
End If
Next
End Sub
Private Sub cmdQuitter()
Unload Me
End Sub |
Partager