Bonjour à tous,
Je vous sollicite car j'ai un soucis sur un projet.
Mon 1er soucis est concernant la sécurité de mon projet, je n'arrive pas a mettre des protections sans l'apparition de "bug" à répétition.
Mon 2ème soucis est que quand je veux réimporter des données, dans le dernier formulaire seulement une partie des infos s'affiche.
Petite précision et non des moindre, je ne suis pas du tout expert en VBA, j'ai développer le projet en allant à la peche au infos sur différents sites.
Private Sub adhesion_Change()
End Sub
Private Sub Cadres_Change()
If Cadres.Value = "" Then Cadres.Value = 0
If Noncadres.Value = "" Then Noncadres.Value = 0
garantiedécès.Clear
garantiedécès.AddItem "Module 1"
garantiedécès.AddItem "Module 2"
garantiedécès.AddItem "Module 3"
garantiedécès.AddItem "Module 4"
garantierenfort.Clear
garantierenfort.AddItem ""
garantierenfort.AddItem "Module 1"
garantierenfort.AddItem "Module 2"
garantierenfort.AddItem "Module 3"
garantierenfort.AddItem "Module 4"
garantierenteéducation1.Clear
garantierenteéducation1.AddItem ""
garantierenteéducation1.AddItem "Option 1"
garantierenteéducation1.AddItem "Option 2"
garantierenteéducation1.AddItem "Option 3"
garantierenteéducation1.AddItem "Option 4"
garantierenteéducation2.Clear
garantierenteéducation2.AddItem ""
garantierenteéducation2.AddItem "Option 5"
garantierenteéducation2.AddItem "Option 6"
garantierenteéducation2.AddItem "Option 7"
garantierenteéducation2.AddItem "Option 8"
garantierenteconjoint1.Clear
garantierenteconjoint1.AddItem ""
garantierenteconjoint1.AddItem "Option 1"
garantierenteconjoint1.AddItem "Option 2"
garantierenteconjoint1.AddItem "Option 3"
garantierenteconjoint1.AddItem "Option 4"
garantierenteconjoint2.Clear
garantierenteconjoint2.AddItem ""
garantierenteconjoint2.AddItem "Option 5"
garantierenteconjoint2.AddItem "Option 6"
garantierenteconjoint2.AddItem "Option 7"
garantierenteconjoint2.AddItem "Option 8"
garantiearrêtdetravail1.Clear
garantiearrêtdetravail1.AddItem ""
garantiearrêtdetravail1.AddItem "Option 1"
garantiearrêtdetravail1.AddItem "Option 2"
garantiearrêtdetravail1.AddItem "Option 3"
garantiearrêtdetravail1.AddItem "Option 4"
garantiearrêtdetravail2.Clear
garantiearrêtdetravail2.AddItem ""
garantiearrêtdetravail2.AddItem "Option 1"
garantiearrêtdetravail2.AddItem "Option 2"
garantiearrêtdetravail2.AddItem "Option 3"
garantiearrêtdetravail2.AddItem "Option 4"
Franchise.Clear
Franchise.AddItem ""
Franchise.AddItem "Option 1"
Franchise.AddItem "Option 2"
Franchise.AddItem "Option 3"
Collège.Clear
Collège.AddItem "Cadres"
Collège.AddItem "Non cadres"
Collège.AddItem "Ensemble du personnel"
Comm_courtier.Clear
Comm_courtier.AddItem "Direct"
Comm_courtier.AddItem "5,00%"
Comm_courtier.AddItem "7,50%"
Comm_courtier.AddItem "10,00%"
Comm_courtier.AddItem "15,00%"
End Sub
Private Sub Noncadres_Change()
If Cadres.Value = "" Then Cadres.Value = 0
If Noncadres.Value = "" Then Noncadres.Value = 0
garantiedécès.Clear
garantiedécès.AddItem "Module 1"
garantiedécès.AddItem "Module 2"
garantiedécès.AddItem "Module 3"
garantiedécès.AddItem "Module 4"
garantierenfort.Clear
garantierenfort.AddItem ""
garantierenfort.AddItem "Module 1"
garantierenfort.AddItem "Module 2"
garantierenfort.AddItem "Module 3"
garantierenfort.AddItem "Module 4"
garantierenteéducation1.Clear
garantierenteéducation1.AddItem ""
garantierenteéducation1.AddItem "Option 1"
garantierenteéducation1.AddItem "Option 2"
garantierenteéducation1.AddItem "Option 3"
garantierenteéducation1.AddItem "Option 4"
garantierenteéducation2.Clear
garantierenteéducation2.AddItem ""
garantierenteéducation2.AddItem "Option 5"
garantierenteéducation2.AddItem "Option 6"
garantierenteéducation2.AddItem "Option 7"
garantierenteéducation2.AddItem "Option 8"
garantierenteconjoint1.Clear
garantierenteconjoint1.AddItem ""
garantierenteconjoint1.AddItem "Option 1"
garantierenteconjoint1.AddItem "Option 2"
garantierenteconjoint1.AddItem "Option 3"
garantierenteconjoint1.AddItem "Option 4"
garantierenteconjoint2.Clear
garantierenteconjoint2.AddItem ""
garantierenteconjoint2.AddItem "Option 5"
garantierenteconjoint2.AddItem "Option 6"
garantierenteconjoint2.AddItem "Option 7"
garantierenteconjoint2.AddItem "Option 8"
garantiearrêtdetravail1.Clear
garantiearrêtdetravail1.AddItem ""
garantiearrêtdetravail1.AddItem "Option 1"
garantiearrêtdetravail1.AddItem "Option 2"
garantiearrêtdetravail1.AddItem "Option 3"
garantiearrêtdetravail1.AddItem "Option 4"
garantiearrêtdetravail2.Clear
garantiearrêtdetravail2.AddItem ""
garantiearrêtdetravail2.AddItem "Option 1"
garantiearrêtdetravail2.AddItem "Option 2"
garantiearrêtdetravail2.AddItem "Option 3"
garantiearrêtdetravail2.AddItem "Option 4"
Franchise.Clear
Franchise.AddItem ""
Franchise.AddItem "Option 1"
Franchise.AddItem "Option 2"
Franchise.AddItem "Option 3"
Collège.Clear
Collège.AddItem "Cadres"
Collège.AddItem "Non cadres"
Collège.AddItem "Ensemble du personnel"
Comm_courtier.Clear
Comm_courtier.AddItem "Direct"
Comm_courtier.AddItem "5,00%"
Comm_courtier.AddItem "7,50%"
Comm_courtier.AddItem "10,00%"
Comm_courtier.AddItem "15,00%"
End Sub
' Précédent pour aller sur Gestion de la feuille paramètre
Private Sub cmdAnnuler_Click()
If tarif.cmdAnnuler.Enabled = True Then
tarif.hide
Gestion.Show
End If
End Sub
Private Sub UserForm_Initialize()
adhesion = Date
Collège.AddItem "Cadres"
Collège.AddItem "Non cadres"
Collège.AddItem "Ensemble du personnel"
garantiedécès.AddItem "Module 1"
garantiedécès.AddItem "Module 2"
garantiedécès.AddItem "Module 3"
garantiedécès.AddItem "Module 4"
garantierenfort.AddItem ""
garantierenfort.AddItem "Module 1"
garantierenfort.AddItem "Module 2"
garantierenfort.AddItem "Module 3"
garantierenfort.AddItem "Module 4"
garantierenteéducation1.AddItem ""
garantierenteéducation1.AddItem "Option 1"
garantierenteéducation1.AddItem "Option 2"
garantierenteéducation1.AddItem "Option 3"
garantierenteéducation1.AddItem "Option 4"
garantierenteéducation2.AddItem ""
garantierenteéducation2.AddItem "Option 5"
garantierenteéducation2.AddItem "Option 6"
garantierenteéducation2.AddItem "Option 7"
garantierenteéducation2.AddItem "Option 8"
garantierenteconjoint1.AddItem ""
garantierenteconjoint1.AddItem "Option 1"
garantierenteconjoint1.AddItem "Option 2"
garantierenteconjoint1.AddItem "Option 3"
garantierenteconjoint1.AddItem "Option 4"
garantierenteconjoint2.AddItem ""
garantierenteconjoint2.AddItem "Option 5"
garantierenteconjoint2.AddItem "Option 6"
garantierenteconjoint2.AddItem "Option 7"
garantierenteconjoint2.AddItem "Option 8"
garantiearrêtdetravail1.AddItem ""
garantiearrêtdetravail1.AddItem "Option 1"
garantiearrêtdetravail1.AddItem "Option 2"
garantiearrêtdetravail1.AddItem "Option 3"
garantiearrêtdetravail1.AddItem "Option 4"
garantiearrêtdetravail2.AddItem ""
garantiearrêtdetravail2.AddItem "Option 1"
garantiearrêtdetravail2.AddItem "Option 2"
garantiearrêtdetravail2.AddItem "Option 3"
garantiearrêtdetravail2.AddItem "Option 4"
Franchise.AddItem ""
Franchise.AddItem "Option 1"
Franchise.AddItem "Option 2"
Franchise.AddItem "Option 3"
Cadres.Value = 0
Noncadres.Value = 0
Effectif = 0
Collège.ListIndex = 0
garantiedécès.ListIndex = 0
garantierenfort.ListIndex = 0
garantierenteéducation1.ListIndex = 0
garantierenteéducation2.ListIndex = 0
garantierenteconjoint1.ListIndex = 0
garantierenteconjoint2.ListIndex = 0
garantiearrêtdetravail1.ListIndex = 0
Franchise.ListIndex = 0
Comm_courtier.AddItem "Direct"
Comm_courtier.AddItem "5,00%"
Comm_courtier.AddItem "7,50%"
Comm_courtier.AddItem "10,00%"
Comm_courtier.AddItem "15,00%"
Comm_courtier.ListIndex = 0
End Sub
Private Sub CmdValider_Click()
If tarif.cmdValider.Enabled = True Then
'définition variable taille_ent: effectif de l'entreprise
taille_ent = CInt(Cadres.Value) + CInt(Noncadres.Value)
'Contrôle de la taille de l'entreprise
If taille_ent > 100 Then
MsgBox "Attention le nombre d'adhérents total est supérieur à 100, vous devez demander une validation de la Direction Technique"
End If
Else
'Définition de la variable qui correspond à la garantie
Select Case (garantiedécès.Value)
Case ("Module 1")
garantiedécès = "01"
Case ("Module 2")
garantiedécès = "02"
Case ("Module 3")
garantiedécès = "03"
Case ("Module 4")
garantiedécès = "04"
End Select
Select Case (garantierenfort.Value)
Case ("Module 1")
garantierenfort = "01"
Case ("Module 2")
garantierenfort = "02"
Case ("Module 3")
garantierenfort = "03"
Case ("Module 4")
garantierenfort = "04"
End Select
Select Case (garantierenteéducation1.Value)
Case ("Option 1")
garantierenteéducation1 = "01"
Case ("Option 2")
garantierenteéducation1 = "02"
Case ("Option 3")
garantierenteéducation1 = "03"
Case ("Option 4")
garantierenteéducation1 = "04"
End Select
Select Case (garantierenteéducation2.Value)
Case ("Option 5")
garantierenteéducation2 = "05"
Case ("Option 6")
garantierenteéducation2 = "06"
Case ("Option 7")
garantierenteéducation2 = "07"
Case ("Option 8")
garantierenteéducation2 = "08"
End Select
Select Case (garantierenteconjoint1.Value)
Case ("Option 1")
garantierenteconjoint1 = "01"
Case ("Option 2")
garantierenteconjoint1 = "02"
Case ("Option 3")
garantierenteconjoint1 = "03"
Case ("Option 4")
garantierenteconjoint1 = "04"
End Select
Select Case (garantierenteconjoint2.Value)
Case ("Option 5")
garantierenteconjoint2 = "05"
Case ("Option 6")
garantierenteconjoint2 = "06"
Case ("Option 7")
garantierenteconjoint2 = "07"
Case ("Option 8")
garantierenteconjoint2 = "08"
End Select
Select Case (garantiearrêtdetravail1.Value)
Case ("Option 1")
garantiearrêtdetravail1 = "01"
Case ("Option 2")
garantiearrêtdetravail1 = "02"
Case ("Option 3")
garantiearrêtdetravail1 = "03"
Case ("Option 4")
garantiearrêtdetravail1 = "04"
End Select
Select Case (garantiearrêtdetravail2.Value)
Case ("Option 1")
garantiearrêtdetravail2 = "01"
Case ("Option 2")
garantiearrêtdetravail2 = "02"
Case ("Option 3")
garantiearrêtdetravail2 = "03"
Case ("Option 4")
garantiearrêtdetravail2 = "04"
End Select
Select Case (Franchise.Value)
Case ("Option 1")
Franchise = "01"
Case ("Option 2")
Franchise = "02"
Case ("Option 3")
Franchise = "03"
End Select
End If
Select Case (Collège.Value)
Case ("Cadres")
Collège = "Cadres"
Sheets("Calcul").Cells(2, 2).Value = 1
Case ("Non cadres")
Collège = "Non cadres"
Sheets("Calcul").Cells(2, 2).Value = 2
Case ("Ensemble du personnel")
Collège = "Ensemble du personnel"
Sheets("Calcul").Cells(2, 2).Value = 3
End Select
Select Case (Comm_courtier.Value)
Case ("Direct")
comm = 1
Sheets("Calcul").Cells(29, 2) = 5
Case ("5,00%")
comm = 2
Sheets("Calcul").Cells(29, 2) = 5
Case ("7,50%")
comm = 3
Sheets("Calcul").Cells(29, 2) = 8
Case ("10,00%")
comm = 4
Sheets("Calcul").Cells(29, 2) = 11
Case ("15,00%")
comm = 5
Sheets("Calcul").Cells(29, 2) = 14
End Select
'Renvoie les variables dans la feuille calcul
Sheets("Calcul").Cells(7, 2).Value = Cadres.Value
Sheets("Calcul").Cells(8, 2).Value = Noncadres.Value
If Collège.Value = "" Then
MsgBox "Attention vous n'avez pas sélectionné le collège souhaité"
tarif.hide
tarif.Show
End If
If garantiedécès.Value = "" Then
MsgBox "Attention vous n'avez pas sélectionné la garantie souhaitée."
tarif.hide
tarif.Show
Else
Sheets("Calcul").Cells(10, 4).Value = garantiedécès
End If
Sheets("Calcul").Cells(11, 4).Value = garantierenfort
Sheets("Calcul").Cells(12, 4).Value = garantierenteéducation1
Sheets("Calcul").Cells(13, 4).Value = garantierenteéducation2
Sheets("Calcul").Cells(14, 4).Value = garantierenteconjoint1
Sheets("Calcul").Cells(15, 4).Value = garantierenteconjoint2
Sheets("Calcul").Cells(16, 4).Value = garantiearrêtdetravail1
Sheets("Calcul").Cells(17, 4).Value = garantiearrêtdetravail2
If garantierenteéducation1.Value <> "" And garantierenteéducation2.Value <> "" Then
MsgBox "Attention vous ne pouvez pas sélectionné deux formules de rente éducation."
tarif.hide
tarif.Show
End If
If garantierenteconjoint1.Value <> "" And garantierenteconjoint2.Value <> "" Then
MsgBox "Attention vous ne pouvez pas sélectionné deux formules de rente conjoint."
tarif.hide
tarif.Show
End If
If garantiearrêtdetravail1.Value <> "" And garantiearrêtdetravail2.Value <> "" Then
MsgBox "Attention vous ne pouvez pas sélectionné deux garanties arrêt de travail."
tarif.hide
tarif.Show
Else
Sheets("Calcul").Cells(18, 4).Value = Franchise
End If
Sheets("Calcul").Cells(19, 2).Value = comm
If Date > CDate(adhesion) Then
MsgBox "Attention, l'adhésion ne peut être rétroactive"
tarif.hide
tarif.Show
Else
If CDate(adhesion) > CDate("01/01/2011") Then
MsgBox "Attention l'adhésion ne peut avoir lieu après le 1er Janvier 2011"
tarif.hide
tarif.Show
End If
Sheets("Calcul").Cells(80, 1).Value = adhesion
End If
temp = Left(adhesion, 2)
If temp <> "01" Then
MsgBox "Attention l'adhésion ne peut avoir lieu un autre jour que le 1er du mois"
tarif.hide
tarif.Show
End If
'vérification du remplissage de l'âge moyen
If age.Value = "" Then
MsgBox "Attention vous n'avez pas renseigné l'âge moyen du collège sélectionné"
tarif.hide
tarif.Show
Else
Sheets("Calcul").Cells(5, 2).Value = age.Value
End If
'vérification du collège à couvrir
If Collège.Value = "" Then
MsgBox "Attention vous n'avez pas sélectionné le collège à couvrir."
tarif.hide
tarif.Show
End If
'vérification de l'effectif à couvrir
If Collège.Value = "Cadres" And Effectif.Value <> CInt(Cadres.Value) Then
MsgBox "L'effectif à couvrir est erroné."
tarif.hide
tarif.Show
Else
Sheets("Calcul").Cells(9, 2).Value = Effectif
End If
If Collège.Value = "Non cadres" And Effectif.Value <> CInt(Noncadres.Value) Then
MsgBox "L'effectif à couvrir est erroné."
tarif.hide
tarif.Show
End If
If Collège.Value = "Ensemble du personnel" And Effectif.Value <> CInt(Cadres.Value) + CInt(Noncadres.Value) Then
MsgBox "L'effectif à couvrir est erroné."
tarif.hide
tarif.Show
End If
If garantierenfort.Value <> "" And garantiedécès.Value <> garantierenfort Then
MsgBox "L'option renfort doit être identique à la garantie décès"
tarif.hide
tarif.Show
End If
If garantiearrêtdetravail1.Value = "" And garantiearrêtdetravail2.Value = "" And Franchise.Value <> "" Then
MsgBox "Vous devez selectionner une garantie arrêt de travail"
tarif.hide
tarif.Show
End If
If garantierenfort.Value = "" Then
Sheets("Infos entreprise").Visible = True
Sheets("Infos entreprise").Select
Rows("73:78").EntireRow.Hidden = True
Rows("158:158").EntireRow.Hidden = True
Sheets("Infos entreprise").Visible = False
Else
Sheets("Infos entreprise").Visible = True
Sheets("Infos entreprise").Select
Rows("73:78").EntireRow.Hidden = False
Rows("158:158").EntireRow.Hidden = False
Sheets("Infos entreprise").Visible = False
End If
If garantierenteéducation1.Value = "" Then
Sheets("Infos entreprise").Visible = True
Sheets("Infos entreprise").Select
Rows("84:86").EntireRow.Hidden = True
Rows("159:159").EntireRow.Hidden = True
Sheets("Infos entreprise").Visible = False
Else
Sheets("Infos entreprise").Visible = True
Sheets("Infos entreprise").Select
Rows("84:86").EntireRow.Hidden = False
Rows("159:159").EntireRow.Hidden = False
Sheets("Infos entreprise").Visible = False
End If
If garantierenteéducation2.Value = "" Then
Sheets("Infos entreprise").Visible = True
Sheets("Infos entreprise").Select
Rows("79:83").EntireRow.Hidden = True
Rows("159:159").EntireRow.Hidden = True
Sheets("Infos entreprise").Visible = False
Else
Sheets("Infos entreprise").Visible = True
Sheets("Infos entreprise").Select
Rows("79:83").EntireRow.Hidden = False
Rows("159:159").EntireRow.Hidden = False
Sheets("Infos entreprise").Visible = False
End If
If garantierenteconjoint1.Value = "" Then
Sheets("Infos entreprise").Visible = True
Sheets("Infos entreprise").Select
Rows("93:95").EntireRow.Hidden = True
Rows("160:160").EntireRow.Hidden = True
Sheets("Infos entreprise").Visible = False
Else
Sheets("Infos entreprise").Visible = True
Sheets("Infos entreprise").Select
Rows("93:95").EntireRow.Hidden = False
Rows("160:160").EntireRow.Hidden = False
Sheets("Infos entreprise").Visible = False
End If
If garantierenteconjoint2.Value = "" Then
Sheets("Infos entreprise").Visible = True
Sheets("Infos entreprise").Select
Rows("87:92").EntireRow.Hidden = True
Rows("160:160").EntireRow.Hidden = True
Sheets("Infos entreprise").Visible = False
Else
Sheets("Infos entreprise").Visible = True
Sheets("Infos entreprise").Select
Rows("87:92").EntireRow.Hidden = False
Rows("160:160").EntireRow.Hidden = False
Sheets("Infos entreprise").Visible = False
End If
If garantiearrêtdetravail1.Value = "" Then
Sheets("Infos entreprise").Visible = True
Sheets("Infos entreprise").Select
Rows("96:107").EntireRow.Hidden = True
Sheets("Infos entreprise").Visible = False
Else
Sheets("Infos entreprise").Visible = True
Sheets("Infos entreprise").Select
Rows("96:107").EntireRow.Hidden = False
Sheets("Infos entreprise").Visible = False
End If
If garantiearrêtdetravail2.Value = "" Then
Sheets("Infos entreprise").Visible = True
Sheets("Infos entreprise").Select
Rows("108:119").EntireRow.Hidden = True
Sheets("Infos entreprise").Visible = False
Else
Sheets("Infos entreprise").Visible = True
Sheets("Infos entreprise").Select
Rows("108:119").EntireRow.Hidden = False
Sheets("Infos entreprise").Visible = False
End If
If garantiearrêtdetravail1.Value = "" And garantiearrêtdetravail2.Value = "" Then
Sheets("Infos entreprise").Visible = True
Sheets("Infos entreprise").Select
Rows("161:163").EntireRow.Hidden = True
Sheets("Infos entreprise").Visible = False
Else
Sheets("Infos entreprise").Visible = True
Sheets("Infos entreprise").Select
Rows("161:163").EntireRow.Hidden = False
Sheets("Infos entreprise").Visible = False
End If
'vérification que la taille par collège est suffisante
'le nombre de cadre doit être au minimum d'une personne
Select Case (Collège.Value)
Case ("Cadres")
If CInt(Cadres.Value) > 0 Then
tarif.hide
Sheets("Infos entreprise").Visible = True
Sheets("Infos entreprise").Select
Call remplissage
Else
MsgBox "Attention le collège sélectionné n'est pas valide."
End If
'le nombre de non cadres doit être au minimum d'une personne
Case ("Non cadres")
If CInt(Noncadres.Value) > 0 Then
tarif.hide
Sheets("Infos entreprise").Visible = True
Sheets("Infos entreprise").Select
Call remplissage
Else
MsgBox "Attention le collège sélectionné n'est pas valide."
End If
'l'ensemble du personnel doit être d'au moins 6 personnes
Case ("Ensemble du personnel")
If CInt(Cadres.Value) <> 0 And CInt(Noncadres.Value) <> 0 Then
tarif.hide
Sheets("Infos entreprise").Visible = True
Sheets("Infos entreprise").Select
Call remplissage
Else
MsgBox "Attention le collège sélectionné n'est pas valide."
End If
End Select
End Sub
Merci d'avance pour votre aide.
Je vous sollicite car j'ai un soucis sur un projet.
Mon 1er soucis est concernant la sécurité de mon projet, je n'arrive pas a mettre des protections sans l'apparition de "bug" à répétition.
Mon 2ème soucis est que quand je veux réimporter des données, dans le dernier formulaire seulement une partie des infos s'affiche.
Petite précision et non des moindre, je ne suis pas du tout expert en VBA, j'ai développer le projet en allant à la peche au infos sur différents sites.
Private Sub adhesion_Change()
End Sub
Private Sub Cadres_Change()
If Cadres.Value = "" Then Cadres.Value = 0
If Noncadres.Value = "" Then Noncadres.Value = 0
garantiedécès.Clear
garantiedécès.AddItem "Module 1"
garantiedécès.AddItem "Module 2"
garantiedécès.AddItem "Module 3"
garantiedécès.AddItem "Module 4"
garantierenfort.Clear
garantierenfort.AddItem ""
garantierenfort.AddItem "Module 1"
garantierenfort.AddItem "Module 2"
garantierenfort.AddItem "Module 3"
garantierenfort.AddItem "Module 4"
garantierenteéducation1.Clear
garantierenteéducation1.AddItem ""
garantierenteéducation1.AddItem "Option 1"
garantierenteéducation1.AddItem "Option 2"
garantierenteéducation1.AddItem "Option 3"
garantierenteéducation1.AddItem "Option 4"
garantierenteéducation2.Clear
garantierenteéducation2.AddItem ""
garantierenteéducation2.AddItem "Option 5"
garantierenteéducation2.AddItem "Option 6"
garantierenteéducation2.AddItem "Option 7"
garantierenteéducation2.AddItem "Option 8"
garantierenteconjoint1.Clear
garantierenteconjoint1.AddItem ""
garantierenteconjoint1.AddItem "Option 1"
garantierenteconjoint1.AddItem "Option 2"
garantierenteconjoint1.AddItem "Option 3"
garantierenteconjoint1.AddItem "Option 4"
garantierenteconjoint2.Clear
garantierenteconjoint2.AddItem ""
garantierenteconjoint2.AddItem "Option 5"
garantierenteconjoint2.AddItem "Option 6"
garantierenteconjoint2.AddItem "Option 7"
garantierenteconjoint2.AddItem "Option 8"
garantiearrêtdetravail1.Clear
garantiearrêtdetravail1.AddItem ""
garantiearrêtdetravail1.AddItem "Option 1"
garantiearrêtdetravail1.AddItem "Option 2"
garantiearrêtdetravail1.AddItem "Option 3"
garantiearrêtdetravail1.AddItem "Option 4"
garantiearrêtdetravail2.Clear
garantiearrêtdetravail2.AddItem ""
garantiearrêtdetravail2.AddItem "Option 1"
garantiearrêtdetravail2.AddItem "Option 2"
garantiearrêtdetravail2.AddItem "Option 3"
garantiearrêtdetravail2.AddItem "Option 4"
Franchise.Clear
Franchise.AddItem ""
Franchise.AddItem "Option 1"
Franchise.AddItem "Option 2"
Franchise.AddItem "Option 3"
Collège.Clear
Collège.AddItem "Cadres"
Collège.AddItem "Non cadres"
Collège.AddItem "Ensemble du personnel"
Comm_courtier.Clear
Comm_courtier.AddItem "Direct"
Comm_courtier.AddItem "5,00%"
Comm_courtier.AddItem "7,50%"
Comm_courtier.AddItem "10,00%"
Comm_courtier.AddItem "15,00%"
End Sub
Private Sub Noncadres_Change()
If Cadres.Value = "" Then Cadres.Value = 0
If Noncadres.Value = "" Then Noncadres.Value = 0
garantiedécès.Clear
garantiedécès.AddItem "Module 1"
garantiedécès.AddItem "Module 2"
garantiedécès.AddItem "Module 3"
garantiedécès.AddItem "Module 4"
garantierenfort.Clear
garantierenfort.AddItem ""
garantierenfort.AddItem "Module 1"
garantierenfort.AddItem "Module 2"
garantierenfort.AddItem "Module 3"
garantierenfort.AddItem "Module 4"
garantierenteéducation1.Clear
garantierenteéducation1.AddItem ""
garantierenteéducation1.AddItem "Option 1"
garantierenteéducation1.AddItem "Option 2"
garantierenteéducation1.AddItem "Option 3"
garantierenteéducation1.AddItem "Option 4"
garantierenteéducation2.Clear
garantierenteéducation2.AddItem ""
garantierenteéducation2.AddItem "Option 5"
garantierenteéducation2.AddItem "Option 6"
garantierenteéducation2.AddItem "Option 7"
garantierenteéducation2.AddItem "Option 8"
garantierenteconjoint1.Clear
garantierenteconjoint1.AddItem ""
garantierenteconjoint1.AddItem "Option 1"
garantierenteconjoint1.AddItem "Option 2"
garantierenteconjoint1.AddItem "Option 3"
garantierenteconjoint1.AddItem "Option 4"
garantierenteconjoint2.Clear
garantierenteconjoint2.AddItem ""
garantierenteconjoint2.AddItem "Option 5"
garantierenteconjoint2.AddItem "Option 6"
garantierenteconjoint2.AddItem "Option 7"
garantierenteconjoint2.AddItem "Option 8"
garantiearrêtdetravail1.Clear
garantiearrêtdetravail1.AddItem ""
garantiearrêtdetravail1.AddItem "Option 1"
garantiearrêtdetravail1.AddItem "Option 2"
garantiearrêtdetravail1.AddItem "Option 3"
garantiearrêtdetravail1.AddItem "Option 4"
garantiearrêtdetravail2.Clear
garantiearrêtdetravail2.AddItem ""
garantiearrêtdetravail2.AddItem "Option 1"
garantiearrêtdetravail2.AddItem "Option 2"
garantiearrêtdetravail2.AddItem "Option 3"
garantiearrêtdetravail2.AddItem "Option 4"
Franchise.Clear
Franchise.AddItem ""
Franchise.AddItem "Option 1"
Franchise.AddItem "Option 2"
Franchise.AddItem "Option 3"
Collège.Clear
Collège.AddItem "Cadres"
Collège.AddItem "Non cadres"
Collège.AddItem "Ensemble du personnel"
Comm_courtier.Clear
Comm_courtier.AddItem "Direct"
Comm_courtier.AddItem "5,00%"
Comm_courtier.AddItem "7,50%"
Comm_courtier.AddItem "10,00%"
Comm_courtier.AddItem "15,00%"
End Sub
' Précédent pour aller sur Gestion de la feuille paramètre
Private Sub cmdAnnuler_Click()
If tarif.cmdAnnuler.Enabled = True Then
tarif.hide
Gestion.Show
End If
End Sub
Private Sub UserForm_Initialize()
adhesion = Date
Collège.AddItem "Cadres"
Collège.AddItem "Non cadres"
Collège.AddItem "Ensemble du personnel"
garantiedécès.AddItem "Module 1"
garantiedécès.AddItem "Module 2"
garantiedécès.AddItem "Module 3"
garantiedécès.AddItem "Module 4"
garantierenfort.AddItem ""
garantierenfort.AddItem "Module 1"
garantierenfort.AddItem "Module 2"
garantierenfort.AddItem "Module 3"
garantierenfort.AddItem "Module 4"
garantierenteéducation1.AddItem ""
garantierenteéducation1.AddItem "Option 1"
garantierenteéducation1.AddItem "Option 2"
garantierenteéducation1.AddItem "Option 3"
garantierenteéducation1.AddItem "Option 4"
garantierenteéducation2.AddItem ""
garantierenteéducation2.AddItem "Option 5"
garantierenteéducation2.AddItem "Option 6"
garantierenteéducation2.AddItem "Option 7"
garantierenteéducation2.AddItem "Option 8"
garantierenteconjoint1.AddItem ""
garantierenteconjoint1.AddItem "Option 1"
garantierenteconjoint1.AddItem "Option 2"
garantierenteconjoint1.AddItem "Option 3"
garantierenteconjoint1.AddItem "Option 4"
garantierenteconjoint2.AddItem ""
garantierenteconjoint2.AddItem "Option 5"
garantierenteconjoint2.AddItem "Option 6"
garantierenteconjoint2.AddItem "Option 7"
garantierenteconjoint2.AddItem "Option 8"
garantiearrêtdetravail1.AddItem ""
garantiearrêtdetravail1.AddItem "Option 1"
garantiearrêtdetravail1.AddItem "Option 2"
garantiearrêtdetravail1.AddItem "Option 3"
garantiearrêtdetravail1.AddItem "Option 4"
garantiearrêtdetravail2.AddItem ""
garantiearrêtdetravail2.AddItem "Option 1"
garantiearrêtdetravail2.AddItem "Option 2"
garantiearrêtdetravail2.AddItem "Option 3"
garantiearrêtdetravail2.AddItem "Option 4"
Franchise.AddItem ""
Franchise.AddItem "Option 1"
Franchise.AddItem "Option 2"
Franchise.AddItem "Option 3"
Cadres.Value = 0
Noncadres.Value = 0
Effectif = 0
Collège.ListIndex = 0
garantiedécès.ListIndex = 0
garantierenfort.ListIndex = 0
garantierenteéducation1.ListIndex = 0
garantierenteéducation2.ListIndex = 0
garantierenteconjoint1.ListIndex = 0
garantierenteconjoint2.ListIndex = 0
garantiearrêtdetravail1.ListIndex = 0
Franchise.ListIndex = 0
Comm_courtier.AddItem "Direct"
Comm_courtier.AddItem "5,00%"
Comm_courtier.AddItem "7,50%"
Comm_courtier.AddItem "10,00%"
Comm_courtier.AddItem "15,00%"
Comm_courtier.ListIndex = 0
End Sub
Private Sub CmdValider_Click()
If tarif.cmdValider.Enabled = True Then
'définition variable taille_ent: effectif de l'entreprise
taille_ent = CInt(Cadres.Value) + CInt(Noncadres.Value)
'Contrôle de la taille de l'entreprise
If taille_ent > 100 Then
MsgBox "Attention le nombre d'adhérents total est supérieur à 100, vous devez demander une validation de la Direction Technique"
End If
Else
'Définition de la variable qui correspond à la garantie
Select Case (garantiedécès.Value)
Case ("Module 1")
garantiedécès = "01"
Case ("Module 2")
garantiedécès = "02"
Case ("Module 3")
garantiedécès = "03"
Case ("Module 4")
garantiedécès = "04"
End Select
Select Case (garantierenfort.Value)
Case ("Module 1")
garantierenfort = "01"
Case ("Module 2")
garantierenfort = "02"
Case ("Module 3")
garantierenfort = "03"
Case ("Module 4")
garantierenfort = "04"
End Select
Select Case (garantierenteéducation1.Value)
Case ("Option 1")
garantierenteéducation1 = "01"
Case ("Option 2")
garantierenteéducation1 = "02"
Case ("Option 3")
garantierenteéducation1 = "03"
Case ("Option 4")
garantierenteéducation1 = "04"
End Select
Select Case (garantierenteéducation2.Value)
Case ("Option 5")
garantierenteéducation2 = "05"
Case ("Option 6")
garantierenteéducation2 = "06"
Case ("Option 7")
garantierenteéducation2 = "07"
Case ("Option 8")
garantierenteéducation2 = "08"
End Select
Select Case (garantierenteconjoint1.Value)
Case ("Option 1")
garantierenteconjoint1 = "01"
Case ("Option 2")
garantierenteconjoint1 = "02"
Case ("Option 3")
garantierenteconjoint1 = "03"
Case ("Option 4")
garantierenteconjoint1 = "04"
End Select
Select Case (garantierenteconjoint2.Value)
Case ("Option 5")
garantierenteconjoint2 = "05"
Case ("Option 6")
garantierenteconjoint2 = "06"
Case ("Option 7")
garantierenteconjoint2 = "07"
Case ("Option 8")
garantierenteconjoint2 = "08"
End Select
Select Case (garantiearrêtdetravail1.Value)
Case ("Option 1")
garantiearrêtdetravail1 = "01"
Case ("Option 2")
garantiearrêtdetravail1 = "02"
Case ("Option 3")
garantiearrêtdetravail1 = "03"
Case ("Option 4")
garantiearrêtdetravail1 = "04"
End Select
Select Case (garantiearrêtdetravail2.Value)
Case ("Option 1")
garantiearrêtdetravail2 = "01"
Case ("Option 2")
garantiearrêtdetravail2 = "02"
Case ("Option 3")
garantiearrêtdetravail2 = "03"
Case ("Option 4")
garantiearrêtdetravail2 = "04"
End Select
Select Case (Franchise.Value)
Case ("Option 1")
Franchise = "01"
Case ("Option 2")
Franchise = "02"
Case ("Option 3")
Franchise = "03"
End Select
End If
Select Case (Collège.Value)
Case ("Cadres")
Collège = "Cadres"
Sheets("Calcul").Cells(2, 2).Value = 1
Case ("Non cadres")
Collège = "Non cadres"
Sheets("Calcul").Cells(2, 2).Value = 2
Case ("Ensemble du personnel")
Collège = "Ensemble du personnel"
Sheets("Calcul").Cells(2, 2).Value = 3
End Select
Select Case (Comm_courtier.Value)
Case ("Direct")
comm = 1
Sheets("Calcul").Cells(29, 2) = 5
Case ("5,00%")
comm = 2
Sheets("Calcul").Cells(29, 2) = 5
Case ("7,50%")
comm = 3
Sheets("Calcul").Cells(29, 2) = 8
Case ("10,00%")
comm = 4
Sheets("Calcul").Cells(29, 2) = 11
Case ("15,00%")
comm = 5
Sheets("Calcul").Cells(29, 2) = 14
End Select
'Renvoie les variables dans la feuille calcul
Sheets("Calcul").Cells(7, 2).Value = Cadres.Value
Sheets("Calcul").Cells(8, 2).Value = Noncadres.Value
If Collège.Value = "" Then
MsgBox "Attention vous n'avez pas sélectionné le collège souhaité"
tarif.hide
tarif.Show
End If
If garantiedécès.Value = "" Then
MsgBox "Attention vous n'avez pas sélectionné la garantie souhaitée."
tarif.hide
tarif.Show
Else
Sheets("Calcul").Cells(10, 4).Value = garantiedécès
End If
Sheets("Calcul").Cells(11, 4).Value = garantierenfort
Sheets("Calcul").Cells(12, 4).Value = garantierenteéducation1
Sheets("Calcul").Cells(13, 4).Value = garantierenteéducation2
Sheets("Calcul").Cells(14, 4).Value = garantierenteconjoint1
Sheets("Calcul").Cells(15, 4).Value = garantierenteconjoint2
Sheets("Calcul").Cells(16, 4).Value = garantiearrêtdetravail1
Sheets("Calcul").Cells(17, 4).Value = garantiearrêtdetravail2
If garantierenteéducation1.Value <> "" And garantierenteéducation2.Value <> "" Then
MsgBox "Attention vous ne pouvez pas sélectionné deux formules de rente éducation."
tarif.hide
tarif.Show
End If
If garantierenteconjoint1.Value <> "" And garantierenteconjoint2.Value <> "" Then
MsgBox "Attention vous ne pouvez pas sélectionné deux formules de rente conjoint."
tarif.hide
tarif.Show
End If
If garantiearrêtdetravail1.Value <> "" And garantiearrêtdetravail2.Value <> "" Then
MsgBox "Attention vous ne pouvez pas sélectionné deux garanties arrêt de travail."
tarif.hide
tarif.Show
Else
Sheets("Calcul").Cells(18, 4).Value = Franchise
End If
Sheets("Calcul").Cells(19, 2).Value = comm
If Date > CDate(adhesion) Then
MsgBox "Attention, l'adhésion ne peut être rétroactive"
tarif.hide
tarif.Show
Else
If CDate(adhesion) > CDate("01/01/2011") Then
MsgBox "Attention l'adhésion ne peut avoir lieu après le 1er Janvier 2011"
tarif.hide
tarif.Show
End If
Sheets("Calcul").Cells(80, 1).Value = adhesion
End If
temp = Left(adhesion, 2)
If temp <> "01" Then
MsgBox "Attention l'adhésion ne peut avoir lieu un autre jour que le 1er du mois"
tarif.hide
tarif.Show
End If
'vérification du remplissage de l'âge moyen
If age.Value = "" Then
MsgBox "Attention vous n'avez pas renseigné l'âge moyen du collège sélectionné"
tarif.hide
tarif.Show
Else
Sheets("Calcul").Cells(5, 2).Value = age.Value
End If
'vérification du collège à couvrir
If Collège.Value = "" Then
MsgBox "Attention vous n'avez pas sélectionné le collège à couvrir."
tarif.hide
tarif.Show
End If
'vérification de l'effectif à couvrir
If Collège.Value = "Cadres" And Effectif.Value <> CInt(Cadres.Value) Then
MsgBox "L'effectif à couvrir est erroné."
tarif.hide
tarif.Show
Else
Sheets("Calcul").Cells(9, 2).Value = Effectif
End If
If Collège.Value = "Non cadres" And Effectif.Value <> CInt(Noncadres.Value) Then
MsgBox "L'effectif à couvrir est erroné."
tarif.hide
tarif.Show
End If
If Collège.Value = "Ensemble du personnel" And Effectif.Value <> CInt(Cadres.Value) + CInt(Noncadres.Value) Then
MsgBox "L'effectif à couvrir est erroné."
tarif.hide
tarif.Show
End If
If garantierenfort.Value <> "" And garantiedécès.Value <> garantierenfort Then
MsgBox "L'option renfort doit être identique à la garantie décès"
tarif.hide
tarif.Show
End If
If garantiearrêtdetravail1.Value = "" And garantiearrêtdetravail2.Value = "" And Franchise.Value <> "" Then
MsgBox "Vous devez selectionner une garantie arrêt de travail"
tarif.hide
tarif.Show
End If
If garantierenfort.Value = "" Then
Sheets("Infos entreprise").Visible = True
Sheets("Infos entreprise").Select
Rows("73:78").EntireRow.Hidden = True
Rows("158:158").EntireRow.Hidden = True
Sheets("Infos entreprise").Visible = False
Else
Sheets("Infos entreprise").Visible = True
Sheets("Infos entreprise").Select
Rows("73:78").EntireRow.Hidden = False
Rows("158:158").EntireRow.Hidden = False
Sheets("Infos entreprise").Visible = False
End If
If garantierenteéducation1.Value = "" Then
Sheets("Infos entreprise").Visible = True
Sheets("Infos entreprise").Select
Rows("84:86").EntireRow.Hidden = True
Rows("159:159").EntireRow.Hidden = True
Sheets("Infos entreprise").Visible = False
Else
Sheets("Infos entreprise").Visible = True
Sheets("Infos entreprise").Select
Rows("84:86").EntireRow.Hidden = False
Rows("159:159").EntireRow.Hidden = False
Sheets("Infos entreprise").Visible = False
End If
If garantierenteéducation2.Value = "" Then
Sheets("Infos entreprise").Visible = True
Sheets("Infos entreprise").Select
Rows("79:83").EntireRow.Hidden = True
Rows("159:159").EntireRow.Hidden = True
Sheets("Infos entreprise").Visible = False
Else
Sheets("Infos entreprise").Visible = True
Sheets("Infos entreprise").Select
Rows("79:83").EntireRow.Hidden = False
Rows("159:159").EntireRow.Hidden = False
Sheets("Infos entreprise").Visible = False
End If
If garantierenteconjoint1.Value = "" Then
Sheets("Infos entreprise").Visible = True
Sheets("Infos entreprise").Select
Rows("93:95").EntireRow.Hidden = True
Rows("160:160").EntireRow.Hidden = True
Sheets("Infos entreprise").Visible = False
Else
Sheets("Infos entreprise").Visible = True
Sheets("Infos entreprise").Select
Rows("93:95").EntireRow.Hidden = False
Rows("160:160").EntireRow.Hidden = False
Sheets("Infos entreprise").Visible = False
End If
If garantierenteconjoint2.Value = "" Then
Sheets("Infos entreprise").Visible = True
Sheets("Infos entreprise").Select
Rows("87:92").EntireRow.Hidden = True
Rows("160:160").EntireRow.Hidden = True
Sheets("Infos entreprise").Visible = False
Else
Sheets("Infos entreprise").Visible = True
Sheets("Infos entreprise").Select
Rows("87:92").EntireRow.Hidden = False
Rows("160:160").EntireRow.Hidden = False
Sheets("Infos entreprise").Visible = False
End If
If garantiearrêtdetravail1.Value = "" Then
Sheets("Infos entreprise").Visible = True
Sheets("Infos entreprise").Select
Rows("96:107").EntireRow.Hidden = True
Sheets("Infos entreprise").Visible = False
Else
Sheets("Infos entreprise").Visible = True
Sheets("Infos entreprise").Select
Rows("96:107").EntireRow.Hidden = False
Sheets("Infos entreprise").Visible = False
End If
If garantiearrêtdetravail2.Value = "" Then
Sheets("Infos entreprise").Visible = True
Sheets("Infos entreprise").Select
Rows("108:119").EntireRow.Hidden = True
Sheets("Infos entreprise").Visible = False
Else
Sheets("Infos entreprise").Visible = True
Sheets("Infos entreprise").Select
Rows("108:119").EntireRow.Hidden = False
Sheets("Infos entreprise").Visible = False
End If
If garantiearrêtdetravail1.Value = "" And garantiearrêtdetravail2.Value = "" Then
Sheets("Infos entreprise").Visible = True
Sheets("Infos entreprise").Select
Rows("161:163").EntireRow.Hidden = True
Sheets("Infos entreprise").Visible = False
Else
Sheets("Infos entreprise").Visible = True
Sheets("Infos entreprise").Select
Rows("161:163").EntireRow.Hidden = False
Sheets("Infos entreprise").Visible = False
End If
'vérification que la taille par collège est suffisante
'le nombre de cadre doit être au minimum d'une personne
Select Case (Collège.Value)
Case ("Cadres")
If CInt(Cadres.Value) > 0 Then
tarif.hide
Sheets("Infos entreprise").Visible = True
Sheets("Infos entreprise").Select
Call remplissage
Else
MsgBox "Attention le collège sélectionné n'est pas valide."
End If
'le nombre de non cadres doit être au minimum d'une personne
Case ("Non cadres")
If CInt(Noncadres.Value) > 0 Then
tarif.hide
Sheets("Infos entreprise").Visible = True
Sheets("Infos entreprise").Select
Call remplissage
Else
MsgBox "Attention le collège sélectionné n'est pas valide."
End If
'l'ensemble du personnel doit être d'au moins 6 personnes
Case ("Ensemble du personnel")
If CInt(Cadres.Value) <> 0 And CInt(Noncadres.Value) <> 0 Then
tarif.hide
Sheets("Infos entreprise").Visible = True
Sheets("Infos entreprise").Select
Call remplissage
Else
MsgBox "Attention le collège sélectionné n'est pas valide."
End If
End Select
End Sub
Merci d'avance pour votre aide.