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 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286
|
Function TriTableau(Valeur)
Dim Debut As Integer, Fin As Integer
Dim i As Integer, j As Integer
Dim temp
Debut = LBound(Valeur)
Fin = UBound(Valeur)
For i = Debut To Fin
For j = i To Fin
If Valeur(i) > Valeur(j) Then
temp = Valeur(j)
Valeur(j) = Valeur(i)
Valeur(i) = temp
End If
Next j
Next i
TriTableau = Valeur
End Function
Private Sub Workbook_BeforeClose(Cancel As Boolean)
' Cette macro sert à vérifier que toutes les questions ont leur réponse afin que l'utilisateur soit certain de n'avoir pas passé une seule question.
Application.ScreenUpdating = False
' Dim OkPourSauvegarde As Boolean
Dim Msg As String
Dim Manquants As String
' Dim Empl As Integer
' OkPourSauvegarde = False
MsgFr = "Lignes ou cellules : "
MsgNl = "Lijnen of cellen: "
' 123456789012345678901
If Range("B12") = "FR" Then Msg = MsgFr Else Msg = MsgNl
Worksheets("Checklist").Select
ActiveSheet.Unprotect ("30082013")
Application.EnableEvents = False
If Range("D4") = "" Then Msg = Msg & "04|"
If Range("G4") = "" Then Msg = Msg & "04|"
If Range("J4") = "" Then Msg = Msg & "04|"
If Range("F6") = "" Then Msg = Msg & "06|"
If Range("F8") = "" Then Msg = Msg & "08|"
If Range("F10") = "" Then Msg = Msg & "10|"
If Range("F12") = "" Then Msg = Msg & "12|"
'===================================================
' Début de la vérification de l'encadré Nieuweklant
'===================================================
If (Blad1.NieuweJa.Value = False And Blad1.NieuweNeen.Value = False) Then
Msg = Msg & Blad1.Shapes("NieuweNeen").TopLeftCell.Row & "|" ' On modifie le msg si l'utilisateur n'a pas répondu à la question d'en-tête
ElseIf Blad1.NieuweJa.Value = True Then ' et on vérifie si on a toutes les réponses lorsqu'il a répondu "oui" à la question d'en-tête. S'il a répondu "non", on ne fait rien.
If Blad1.VakbondJa.Value = False And Blad1.VakbondNeen.Value = False Then Msg = Msg & Blad1.Shapes("VakbondNeen").TopLeftCell.Row & "|"
If Blad1.VasteFeeNA.Value = False And Blad1.VasteFeeWB.Value = False And Blad1.VasteFeeGV.Value = False Then Msg = Msg & Blad1.Shapes("VasteFeeGV").TopLeftCell.Row & "|"
If Blad1.ADVB.Value = False And Blad1.ADVNA.Value = False And Blad1.ADVO.Value = False Then Msg = Msg & Blad1.Shapes("ADVO").TopLeftCell.Row & "|"
If Blad1.StatuutA.Value = False And Blad1.StatuutB.Value = False And Blad1.StatuutSA.Value = False And Blad1.StatuutSB.Value = False Then Msg = Msg & Blad1.Shapes("StatuutA").TopLeftCell.Row & "|"
If Blad1.InlezenPrestatiesJa.Value = False And Blad1.InlezenPrestatiesNeen.Value = False Then Msg = Msg & Blad1.Shapes("InlezenPrestatiesNeen").TopLeftCell.Row & "|"
If Blad1.UurroosterJa.Value = False And Blad1.UurroosterNeen.Value = False Then Msg = Msg & Blad1.Shapes("UurroosterNeen").TopLeftCell.Row & "|"
If Blad1.KostenplaatsJa.Value = False And Blad1.KostenplaatsNeen.Value = False Then Msg = Msg & Blad1.Shapes("KostenPlaatsNeen").TopLeftCell.Row & "|"
If Blad1.DagContractJa.Value = False And Blad1.DagContractNeen.Value = False Then Msg = Msg & Blad1.Shapes("DagContractenNeen").TopLeftCell.Row & "|"
If Blad1.PloegenPremiesJa.Value = False And Blad1.PloegenPremiesNeen.Value = False Then Msg = Msg & Blad1.Shapes("PloegenPremiesNeen").TopLeftCell.Row & "|"
If Blad1.PremiesJa.Value = False And Blad1.PremiesNeen.Value = False Then Msg = Msg & Blad1.Shapes("PremiesNeen").TopLeftCell.Row & "|"
If Blad1.MaaltijdchequesJa.Value = False And Blad1.MaaltijdchequesNeen.Value = False And Blad1.MaaltijdchequesNA.Value = False And Range("L" & Blad1.Shapes("MaaltijdchequesNeen").TopLeftCell.Row) = "" Then Msg = Msg & Blad1.Shapes("MaaltijdchequesNeen").TopLeftCell.Row & "|"
If Blad1.KoopKrachtPremieB.Value = False And Blad1.KoopKrachtPremieNA.Value = False And Blad1.KoopKrachtPremieGV.Value = False Then Msg = Msg & Blad1.Shapes("KoopKrachtPremieGV").TopLeftCell.Row & "|"
If Blad1.ContactPersoonFactuurInOrde.Value = False Then Msg = Msg & Blad1.Shapes("ContactPersoonFactuurInOrde").TopLeftCell.Row & "|"
If Blad1.ContactPersoonSelfServInOrde.Value = False Then Msg = Msg & Blad1.Shapes("ContactPersoonSelfServInOrde").TopLeftCell.Row & "|"
If Blad1.NieuweASRVakPlanInOrde.Value = False Then Msg = Msg & Blad1.Shapes("NieuweASRVakplanInOrde").TopLeftCell.Row & "|"
If Blad1.ContactPersoonSelfContrInOrde.Value = False And Blad1.ContactPersoonSelfContrNA.Value = False Then Msg = Msg & Blad1.Shapes("ContactPersoonSelfContrInOrde").TopLeftCell.Row & "|"
If Blad1.dagcontractenJa.Value = False And Blad1.dagcontractenNeen.Value = False Then Msg = Msg & Blad1.Shapes("dagcontractenNeen").TopLeftCell.Row & "|"
If Blad1.DocOpDagContracten.Value = False Then Msg = Msg & Blad1.Shapes("DocOpDagContracten").TopLeftCell.Row & "|"
' Vérification des données des cellules contenant des valeurs
LigneCrt = ActiveSheet.Shapes("NieuweRAZ").TopLeftCell.Row
If Range("J" & LigneCrt) = "" Then Msg = Msg & LigneCrt & "|"
LigneCrt = ActiveSheet.Shapes("UrenVoltijdsRAZ").TopLeftCell.Row
If Range("J" & LigneCrt) = "" Then Msg = Msg & LigneCrt & "|"
LigneCrt = ActiveSheet.Shapes("UrenCAORAZ").TopLeftCell.Row
If Range("J" & LigneCrt) = "" Then Msg = Msg & LigneCrt & "|"
LigneCrt = ActiveSheet.Shapes("PCRAZ").TopLeftCell.Row
If Range("I" & LigneCrt) = "" Then Msg = Msg & LigneCrt & "|"
End If
'=================================================
' Fin de la vérification de l'encadré Nieuweklant
'=================================================
'===================================================
' Début de la vérification de l'encadré Vreemdeling
'===================================================
LigneCrt = ActiveSheet.Shapes("VreemdelingRAZ").TopLeftCell.Row
If Range("H" & LigneCrt) = "" Then
Msg = Msg & LigneCrt & "|"
ElseIf UCase(Range("H" & LigneCrt)) <> "BE" Then
If Blad1.VreemIDGelinktinEPInOrde.Value = False Then Msg = Msg & Blad1.Shapes("VreemIDGelinktinEPInOrde").TopLeftCell.Row & "|"
If Blad1.VreemIDKaartOpEUInOrde.Value = False Then Msg = Msg & Blad1.Shapes("VreemIDKaartOpEUInOrde").TopLeftCell.Row & "|"
If Blad1.VreemIDVervaldatumInOrde.Value = False Then Msg = Msg & Blad1.Shapes("VreemIDVervaldatumInOrde").TopLeftCell.Row & "|"
If Blad1.VreemIDNummerInOrde.Value = False Then Msg = Msg & Blad1.Shapes("VreemIDNummerInOrde").TopLeftCell.Row & "|"
If Blad1.VreemArbeidskaartVrijgInOrde.Value = False Then Msg = Msg & Blad1.Shapes("VreemArbeidskaartVrijgInOrde").TopLeftCell.Row & "|"
If Blad1.VreemArbeidsVerguningInOrde.Value = False Then Msg = Msg & Blad1.Shapes("VreemArbeidsVerguningInOrde").TopLeftCell.Row & "|"
If Blad1.VreemIDVervaldatum2InOrde.Value = False Then Msg = Msg & Blad1.Shapes("VreemIDVervaldatum2InOrde").TopLeftCell.Row & "|"
If Range("F" & LigneCrt) = "Hors Europe" Or Range("F" & LigneCrt) = "Buiten Europa" Then
If Blad1.VreemFeedbackLoondinOrde.Value = False Then Msg = Msg & Blad1.Shapes("VreemFeedbackLoondinOrde").TopLeftCell.Row & "|"
End If
End If
'=================================================
' Fin de la vérification de l'encadré Vreemdeling
'=================================================
'===============================================
' Début de la vérification de l'encadré Student
'===============================================
If (Blad1.StudentJa.Value = False And Blad1.StudentNeen.Value = False) Then
Msg = Msg & Blad1.Shapes("StudentJa").TopLeftCell.Row & "|"
ElseIf Blad1.StudentJa.Value = True Then
If Blad1.Minder18.Value = False And Blad1.Meer18.Value = False Then Msg = Msg & Blad1.Shapes("Meer18").TopLeftCell.Row & "|"
If Blad1.Contingent.Value = False Then Msg = Msg & Blad1.Shapes("Contingent").TopLeftCell.Row & "|"
End If
'=============================================
' Fin de la vérification de l'encadré Student
'=============================================
'=============================================
' Début de la vérification de l'encadré Flexi
'=============================================
If (Blad1.FlexiJa.Value = False And Blad1.FlexiNeen.Value = False) Then
Msg = Msg & Blad1.Shapes("FlexiJa").TopLeftCell.Row & "|"
ElseIf Blad1.FlexiJa.Value = True Then
If Blad1.IntentieVerkVerstInOrde.Value = False Then Msg = Msg & Blad1.Shapes("IntentieVerkVerstInOrde").TopLeftCell.Row & "|"
If Blad1.FlexiRaamOverVerstInOrde.Value = False Then Msg = Msg & Blad1.Shapes("FlexiRaamOverVerstInOrde").TopLeftCell.Row & "|"
End If
'===========================================
' Fin de la vérification de l'encadré Flexi
'===========================================
'==========================================================
' Début de la vérification de l'encadré WPF van toepassing
'==========================================================
' MODULE INCORRECT EN L'ETAT. DES CONDITIONS DOIVENT ETRE MISES AUX VERIFICATIONS CAR TOUTES LES QUESTIONS NE SONT PAS TOUJOURS POSEES
If Blad1.WPFVanToepassingJa.Value = False And Blad1.WPFVanToepassingNeen.Value = False Then
Msg = Msg & Blad1.Shapes("WPFVanToepassingJa").TopLeftCell.Row & "|"
Else
If Blad1.WPFVanToepassingNeen.Value = True Then
If Blad1.WPFMailKlantGeenRisicoJa.Value = False And Blad1.WPFMailKlantGeenRisicoToDo.Value = False Then Msg = Msg & Blad1.Shapes("WPFMailKlantGeenRisicoJa").TopLeftCell.Row & "|"
End If
If Blad1.WPFAanwezigJa.Value = False And Blad1.WPFAanwezigNeen.Value = False Then Msg = Msg & Blad1.Shapes("WPFAanwezigJa").TopLeftCell.Row & "|"
If Blad1.WPFVeiligheidFunctieJa.Value = False And Blad1.WPFVeiligheidFunctieNeen.Value = False Then Msg = Msg & Blad1.Shapes("WPFVeiligheidFunctieJa").TopLeftCell.Row & "|"
If Blad1.WPFAanwezigNeen.Value = True And Blad1.WPFVeiligheidFunctieNeen.Value = True Then
If Blad1.WPFMailHrbmDmInOrde.Value = False Then Msg = Msg & Blad1.Shapes("WPFMailHrbmDmInOrde").TopLeftCell.Row & "|"
End If
If Blad1.WPFAanwezigJa.Value = True And Blad1.WPFVeiligheidFunctieJa.Value = True Then
If Blad1.WPFMedischGekeurdJa.Value = False And Blad1.WPFMedischGekeurdNeen.Value = False Then Msg = Msg & Blad1.Shapes("WPFMedischGekeurdJa").TopLeftCell.Row & "|"
End If
If (Blad1.WPFAanwezigNeen.Value = True And Blad1.WPFVeiligheidFunctieJa.Value = True) Or Blad1.WPFMedischGekeurdNeen.Value = True Then
If Blad1.WPFMailKlGeenVeiligJa.Value = False And Blad1.WPFMailKlGeenVeiligNeen.Value = False Then Msg = Msg & Blad1.Shapes("WPFMailKlGeenVeiligJa").TopLeftCell.Row & "|"
End If
End If
'========================================================
' Fin de la vérification de l'encadré WPF van toepassing
'========================================================
'===========================================
' Début de la vérification de l'encadré VCU
'===========================================
If Blad1.VCUVanToepassingJa.Value = False And Blad1.VCUVanToepassingNeen.Value = False Then
Msg = Msg & Blad1.Shapes("VCUVanToepassingJa").TopLeftCell.Row & "|"
ElseIf Blad1.VCUVanToepassingJa.Value = True Then
If Blad1.VCUUzkVcuGecertifJa.Value = False And Blad1.VCUUzkVcuGecertifNeen.Value = False Then Msg = Msg & Blad1.Shapes("VCUUzkVcuGecertifJa").TopLeftCell.Row & "|"
If Blad1.VCUUzkVcuGecertifJa.Value = True Then
If Range("K" & Blad1.Shapes("VCUUzkVcuGecertifRAZ").TopLeftCell.Row) = "" Then Msg = Msg & Blad1.Shapes("VCUUzkVcuGecertifRAZ").TopLeftCell.Row & "|"
End If
If Blad1.VCUTijdstipVCAVO.Value = False And Blad1.VCUTijdstipVCAB3.Value = False Then Msg = Msg & Blad1.Shapes("VCUTijdstipVCAVO").TopLeftCell.Row & "|"
If Blad1.VCUUzkVcuGecertifJa.Value = True And Blad1.VCUTijdstipVCAVO.Value = True Then
If Blad1.VCUMeldingKantoorInOrde.Value = False Then Msg = Msg & Blad1.Shapes("VCUMeldingKantoorInOrde").TopLeftCell.Row & "|"
If Blad1.VCUEPKantoorBeheerVCUInOrde.Value = False Then Msg = Msg & Blad1.Shapes("VCUEPKantoorBeheerVCUInOrde").TopLeftCell.Row & "|"
End If
If Blad1.VCUTijdstipVCAB3.Value = True Then
If Blad1.VCUEPKantoorBeheerVCUInOrde.Value = False Then Msg = Msg & Blad1.Shapes("VCUEPKantoorBeheerVCUInOrde").TopLeftCell.Row & "|"
End If
End If
'=========================================
' Fin de la vérification de l'encadré VCU
'=========================================
'================================================
' Début de la vérification de l'encadré Contract
'================================================
If (Blad1.ContractJa.Value = False And Blad1.ContractNeen.Value = False) Then
Msg = Msg & Blad1.Shapes("ContractJa").TopLeftCell.Row & "|"
ElseIf Blad1.ContractJa.Value = True Then
If Blad1.FunctiekwalificatieJa.Value = False And Blad1.FunctiekwalificatieNeen.Value = False Then Msg = Msg & Blad1.Shapes("FunctiekwalificatieJa").TopLeftCell.Row & "|"
If Blad1.Datum.Value = False Then Msg = Msg & Blad1.Shapes("Datum").TopLeftCell.Row & "|"
If Blad1.ContractStatuut.Value = False Then Msg = Msg & Blad1.Shapes("ContractStatuut").TopLeftCell.Row & "|"
If Blad1.Reden.Value = False Then Msg = Msg & Blad1.Shapes("Reden").TopLeftCell.Row & "|"
If Blad1.KantoorBeheer.Value = False Then Msg = Msg & Blad1.Shapes("KantoorBeheer").TopLeftCell.Row & "|"
If Blad1.KantoorUitvoering.Value = False Then Msg = Msg & Blad1.Shapes("KantoorUitvoering").TopLeftCell.Row & "|"
If Blad1.uurloon.Value = False Then Msg = Msg & Blad1.Shapes("uurloon").TopLeftCell.Row & "|"
If Blad1.Coefficient.Value = False Then Msg = Msg & Blad1.Shapes("Coefficient").TopLeftCell.Row & "|"
If Blad1.TypeVerplaatsing.Value = False Then Msg = Msg & Blad1.Shapes("TypeVerplaatsing").TopLeftCell.Row & "|"
If Blad1.ReiskostenPerDag.Value = False Then Msg = Msg & Blad1.Shapes("ReiskostenPerDag").TopLeftCell.Row & "|"
If Blad1.LoonKoopkrachtpremieJa.Value = False And Blad1.LoonKoopkrachtpremieNeen.Value = False And Blad1.LoonKoopkrachtpremieNA.Value = False Then Msg = Msg & Blad1.Shapes("LoonKoopkrachtpremieNA").TopLeftCell.Row & "|"
If Blad1.ContractVakAttestGevrJa.Value = False And Blad1.ContractVakAttestGevrNeen.Value = False And Blad1.ContractVakAttestGevrNA.Value = False Then Msg = Msg & Blad1.Shapes("ContractVakAttestGevrNA").TopLeftCell.Row & "|"
If Blad1.FeeUurJa.Value = False And Blad1.FeeUurNeen.Value = False And Blad1.FeeUurNA.Value = False Then Msg = Msg & Blad1.Shapes("FeeUurNA").TopLeftCell.Row & "|"
If Blad1.VolcontinuJa.Value = False And Blad1.VolcontinuNeen.Value = False And Blad1.VolcontinuNA.Value = False Then Msg = Msg & Blad1.Shapes("VolcontinuJa").TopLeftCell.Row & "|"
If Blad1.VolcontinuJa.Value = True Then
If Blad1.BVVermindering.Value = False Then Msg = Msg & Blad1.Shapes("BVVermindering").TopLeftCell.Row & "|"
End If
If Blad1.LoonMaaltijdchequesJa.Value = False And Blad1.LoonMaaltijdchequesNeen.Value = False And Range("L" & Blad1.Shapes("LoonMaaltijdchequesRAZ").TopLeftCell.Row) = "" Then Msg = Msg & Blad1.Shapes("LoonMaaltijdchequesJa").TopLeftCell.Row & "|"
If Blad1.TewerkstellingKostenplaatsJa.Value = False And Blad1.TewerkstellingKostenplaatsNeen.Value = False Then Msg = Msg & Blad1.Shapes("TewerkstellingKostenplaatsJa").TopLeftCell.Row & "|"
If Blad1.PlaatsTewerkstelling.Value = False Then Msg = Msg & Blad1.Shapes("PlaatsTewerkstelling").TopLeftCell.Row & "|"
If Blad1.AfdrukTijdsregeling.Value = False Then Msg = Msg & Blad1.Shapes("AfdrukTijdsregeling").TopLeftCell.Row & "|"
If Blad1.ContractUurrooster.Value = False Then Msg = Msg & Blad1.Shapes("ContractUurrooster").TopLeftCell.Row & "|"
If Blad1.ContractSjabloonNA.Value = False And Blad1.ContractSjabloonInOrde.Value = False Then Msg = Msg & Blad1.Shapes("ContractSjabloonNA").TopLeftCell.Row & "|"
If Blad1.ASRJa.Value = False And Blad1.ASRNeen.Value = False Then Msg = Msg & Blad1.Shapes("ASRJa").TopLeftCell.Row & "|"
End If
'==============================================
' Fin de la vérification de l'encadré Contract
'==============================================
ActiveWindow.ScrollRow = 14
Application.ScreenUpdating = True
If Len(Msg) > 21 Then
Manquants = Mid(Msg, 22, Len(Msg))
L = 4
C = 18
Empl = Split(Manquants, "|") ' Empl : emplacements
OrdAlpha = TriTableau(Empl) ' Tri des lignes par ordre numérique
NbCol = Range(Cells(1, 1), Cells(4, 16384).End(xlToLeft)).Columns.Count
If NbCol < C Then NbCol = C
Range(Cells(L, C), Cells(12, NbCol)).ClearContents
Range("R2").ClearContents
If Range("B12") = "FR" Then Range("R2").Value = "Réponses manquantes" Else Range("R2").Value = "Ontbrekende antwoorden"
Range("R2").Font.Bold = True
For n = 1 To UBound(OrdAlpha)
Range(Cells(L, C), Cells(L, C)).Value = OrdAlpha(n)
If L = 12 Then
L = 4
C = C + 1
ElseIf Blad1.Rows(L + 1 & ":" & L + 1).RowHeight = 4.2 Then
L = L + 2
Else
L = L + 1
End If
Next
Col = Split(Cells(L, C).Address, "$")
Range("R4:" & Col(1) & "12").Select
With Selection ' centrage des valeurs entrées dans les cellules
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
End If
Call Verrouillage ' Verrouillage des cellules et des feuilles
Range("F6").Select
End Sub |
Partager