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 bt_Ok_Click()
Dim t1 As Variant
Stop
t1 = h1 + h11 + h21 + h31
If h1 <> "0" Then
Workbooks.Open "C:\Documents and Settings\Compaq_Propriétaire\Mes documents\Boulot\aze.xls"
Call Calcul_Temps
Dim lastCell As Range
Dim zone As Range
End If
If h1 <> "0" Then
Set lastCell = Range("b65536").End(xlUp)
Set zone = Range(lastCell, lastCell)
Range(lastCell, lastCell).Offset(1, -1).Select
ActiveCell.Value = tb_date.Text
ActiveCell.Offset(0, 1).Value = ComboBox1.Text
With ActiveCell.Offset(0, 2)
.Value = h1
.NumberFormat = "hh:mm"
End With
ActiveCell.Offset(0, 3).Value = Application.UserName
End If
If h11 <> "0" Then
Set lastCell = Range("b65536").End(xlUp)
Set zone = Range(lastCell, lastCell)
Range(lastCell, lastCell).Offset(1, -1).Select
ActiveCell.Value = tb_date.Text
ActiveCell.Offset(0, 1).Value = ComboBox2.Text
With ActiveCell.Offset(0, 2)
.Value = h11
.NumberFormat = "hh:mm"
End With
ActiveCell.Offset(0, 3).Value = Application.UserName
End If
If h21 <> "0" Then
Set lastCell = Range("b65536").End(xlUp)
Set zone = Range(lastCell, lastCell)
Range(lastCell, lastCell).Offset(1, -1).Select
ActiveCell.Value = tb_date.Text
ActiveCell.Offset(0, 1).Value = ComboBox3.Text
With ActiveCell.Offset(0, 2)
.Value = h21
.NumberFormat = "hh:mm"
End With
ActiveCell.Offset(0, 3).Value = Application.UserName
End If
If h31 <> "0" Then
Set lastCell = Range("b65536").End(xlUp)
Set zone = Range(lastCell, lastCell)
Range(lastCell, lastCell).Offset(1, -1).Select
ActiveCell.Value = tb_date.Text
ActiveCell.Offset(0, 1).Value = ComboBox4.Text
With ActiveCell.Offset(0, 2)
.Value = h31
.NumberFormat = "hh:mm"
End With
ActiveCell.Offset(0, 3).Value = Application.UserName
End If
Unload Me
If t1 <> "0" Then
With ActiveWorkbook
.Save
'.Close
End With
End If
End Sub |
Partager