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 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131
|
Option Explicit
Option Base 1
Public util As String
Public OpbBouton() As New MdCOpb
Public upOpbBouton() As New upmdcopb
Public upvaliderbouton() As New updata
Public txtbox() As New Classe3
Public uptxtbox() As New Classe2
Public utilisateur() As New Classe1
Public choixaudit() As New choixaudit
Public choixsousaudit() As New choixsousaudit
Public retourbouton() As New retour
Public validerbouton() As New valider
Public userbouton() As New valuser
Public datemaj() As New datemaj
Public mcmaj() As New mcmaj
Public choix1() As New choix
Public quitter() As New quit
Public Collect As Collection
Public user, auditmc, auditsousmc, email As String
Public jour As Date
Public DerLg As Long
Public Derlg2 As Long
Public derlg3, derlg4, derlg5, derlgm, derlgc, derlgmc, derlgsmc, derlg10, derlg12, derlgnbm, derlgrev, machin As Long
Public frequence, userlogin, rev, w, i, j, x, majdate, majmc As Variant
Public realisej, realises, realisem, realisea, Nbjm, realise3, result, resultna, nbok, nbnok, nbna As Long
Public proddt, proddt2, dt, mois, annee, week, prod, dateenr, dateeq, revmc As Variant
Public eq1 As Range
Public reponse(1, 10)
Public quest()
Public adresse(5)
Public date_enr(5), eq, eq2, centre, MC, mc2, s As Variant
Public typemc()
Public adr(50)
Declare Function GetSystemMetrics32 Lib "user32" _
Alias "GetSystemMetrics" (ByVal nIndex As Long) As Long
Private Declare Function GetUserName Lib "advapi32.dll" Alias "GetUserNameA" (ByVal lpBuffer As String, nSize As Long) As Long
Function Get_Login() As String
'Récupération et renvoi du login windows
Dim lpBuff As String * 25
Dim ret As Long
'Extraction du login
ret = GetUserName(lpBuff, 25)
'Renvoi
Get_Login = Left(lpBuff, InStr(lpBuff, Chr(0)) - 1)
End Function
Public Function NombreDeJoursDansMois(MaDate As Date)
NombreDeJoursDansMois = Day(DateSerial(Year(DateAdd("m", 1, Now())), Month(DateAdd("m", 1, Now())), 1) - 1)
End Function
Private Sub Auto_Open()
DEMMARAGE
End Sub
Sub DEMMARAGE()
Dim user As String
Dim NbCol As Integer
Dim NbRow As Integer
Dim CopyRange, copyrange1 As Range
Dim PasteRange, pasterange1 As Range
Dim i As Integer
Dim j, x As Integer
Dim tab_quest()
Dim question As Long
realisej = 0 'A1'
realises = 0 'A2'
realisem = 0 'B1'
realisea = 0 'B2'
realise3 = 0 'B3'
jour = Now()
mois = Month(Now())
week = DatePart("ww", Now())
annee = Year(Now())
proddt = Format(jour, "yyyymmdd")
Nbjm = Day(DateSerial(Year(DateAdd("m", 1, Now())), Month(DateAdd("m", 1, Now())), 1) - 1)
dateenr = ActiveWorkbook.BuiltinDocumentProperties("Last save time") 'date dernière enregistrement du fichier
date_enr(1) = ActiveWorkbook.BuiltinDocumentProperties("Last save time") 'date dernière enregistrement du fichier
date_enr(2) = Format(date_enr(1), "yyyymmdd")
date_enr(3) = DatePart("ww", date_enr(1))
date_enr(4) = Month(date_enr(1))
date_enr(5) = Year(date_enr(1))
userlogin = Application.UserName
Sheets(2).Cells.ClearContents
Sheets(10).Cells.ClearContents
Sheets(10).Select
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
Selection.Borders(xlEdgeLeft).LineStyle = xlNone
Selection.Borders(xlEdgeTop).LineStyle = xlNone
Selection.Borders(xlEdgeBottom).LineStyle = xlNone
Selection.Borders(xlEdgeRight).LineStyle = xlNone
Selection.Borders(xlInsideVertical).LineStyle = xlNone
Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
ControleSiOutlookOuvert
If Hour(Now()) < 5 Then
dt = Format(Now() - 1, "yyyymmdd")
dateeq = dt & "3"
Else
If Hour(Now()) > 4 And Hour(Now()) < 13 Then
dt = Format(Now(), "yyyymmdd")
dateeq = dt & "1"
ElseIf Hour(Now()) > 12 And Hour(Now()) < 21 Then
dt = Format(Now(), "yyyymmdd")
dateeq = dt & "2"
Else
dt = Format(Now(), "yyyymmdd")
dateeq = dt & "3"
End If
End If
Set eq1 = Sheets("CALENDRIER").Range("A1:A20000").Find(dateeq, LookIn:=xlValues)
With eq1
eq = eq1.Adress
eq2 = Sheets("Calendrier").Range(eq).Offset(0, 1)
End With |
Partager