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
| Private Sub Workbook_NewSheet(ByVal Sh As Object)
Dim nom As String
Dim status As String
Dim agence As String
Dim cout As String
Dim tempbool
nom = InputBox("Vous allez ajouter une nouvelle feuille. Quel est le nom de l'employé ?", "Nom employé")
status = InputBox("Quel est son statut ?", "Statut")
agence = InputBox("Quelle est son agence/site ?", "Agence/Site")
tempbool = False
While tempbool = False
cout = InputBox("Quel est son coût horaire ?", "Coût/h")
If IsNumeric(cout) = True Then
tempbool = True
Else
MsgBox "Rentrez un nombre valide, nom de Dieu !"
End If
Wend
Application.ScreenUpdating = False
Sh.Name = nom
Sh.Move After:=Sheets(Sheets.Count)
Sheets(nom).Tab.ColorIndex = 41
Sheets("Nouvel Employé").Cells.Copy
Sheets(nom).Paste
Range("A3").Value = nom
Range("B3").Value = status
Range("C3").Value = agence
Range("D3").Value = cout
Sheets(nom).Range("A3:D63").Copy
Sheets("BDD-Mommenheim").Activate
Range("A65536").End(xlUp).Offset(1, 0).Select
Selection.PasteSpecial Paste:=xlPasteValues
Range("E3:AY63").Copy
Range("E65536").End(xlUp).Offset(1, 0).Activate
ActiveSheet.Paste
Application.CutCopyMode = False
Range("A1").Activate
Application.ScreenUpdating = True
End Sub |
Partager