Mise en forme d'une demande d'absence
Résolu/Fermé
Saucisson_47
yg_be
- Messages postés
- 11
- Date d'inscription
- vendredi 23 mars 2018
- Statut
- Membre
- Dernière intervention
- 13 avril 2018
yg_be
- Messages postés
- 19998
- Date d'inscription
- lundi 9 juin 2008
- Statut
- Contributeur
- Dernière intervention
- 10 août 2022
A voir également:
- Mise en forme d'une demande d'absence
- Mise en forme d'une demande d'absence ✓ - Forum - Excel
- Excel mise en forme conditionnelle autre cellule ✓ - Forum - Excel
- Un agent immobilier a préparé un diaporama pour présenter une maison à vendre. appliquez la mise en forme de la première diaposi ✓ - Forum - Powerpoint
- Mise en forme conditionnelle excel - Guide
- Mise en forme conditionnelle en fonction d'une autre cellule ✓ - Forum - Excel
5 réponses
gbinforme
Modifié le 12 avril 2018 à 19:05
- Messages postés
- 14935
- Date d'inscription
- lundi 18 octobre 2004
- Statut
- Contributeur
- Dernière intervention
- 24 juin 2020
Modifié le 12 avril 2018 à 19:05
Bonjour,
Voici le classeur avec la macro que tu souhaites
C'est une macro qui se déclenche à l'ouverture de la feuille 'congé'
https://www.cjoint.com/c/HDmrfuZq56l
Toujours zen
La perfection est atteinte, non pas lorsqu'il n'y a plus rien à ajouter, mais lorsqu'il n'y a plus rien à retirer. Antoine de Saint-Exupéry
Voici le classeur avec la macro que tu souhaites
C'est une macro qui se déclenche à l'ouverture de la feuille 'congé'
https://www.cjoint.com/c/HDmrfuZq56l
Toujours zen
La perfection est atteinte, non pas lorsqu'il n'y a plus rien à ajouter, mais lorsqu'il n'y a plus rien à retirer. Antoine de Saint-Exupéry
yg_be
12 avril 2018 à 19:23
- Messages postés
- 19998
- Date d'inscription
- lundi 9 juin 2008
- Statut
- Contributeur
- Dernière intervention
- 10 août 2022
12 avril 2018 à 19:23
bonsoir, je propose ceci:
Sub demcg() Dim fl As Worksheet Dim ligbl As Long, ligjn As Long, derlig As Long Dim cour As String, acc As String Set fl = ThisWorkbook.Sheets("Congé") derlig = fl.UsedRange.Rows(fl.UsedRange.Rows.Count).Row ligjn = 15 acc = "" For ligbl = 4 To derlig cour = fl.Cells(ligbl, 5) If cour <> "" Then If Left(cour, 1) <> " " Then If acc <> "" Then fl.Cells(ligjn, 9) = acc ligjn = ligjn + 1 End If acc = cour Else acc = acc & cour End If End If Next ligbl If acc <> "" Then fl.Cells(ligjn, 9) = acc End If End Sub
Saucisson_47
13 avril 2018 à 09:15
- Messages postés
- 11
- Date d'inscription
- vendredi 23 mars 2018
- Statut
- Membre
- Dernière intervention
- 13 avril 2018
13 avril 2018 à 09:15
Merci pour vos réponses ! je regarde cela et je vous tiens au courant
Saucisson_47
13 avril 2018 à 10:34
- Messages postés
- 11
- Date d'inscription
- vendredi 23 mars 2018
- Statut
- Membre
- Dernière intervention
- 13 avril 2018
13 avril 2018 à 10:34
Je viens de tester les 2 réponses et elles fonctionnent. Je n'y serai jamais arrivé tout seul... merci encore.
Maintenant il me resterait à faire de même mais en repérant chaque type de congés CA (et CA N-1) CT, RTT, RF et en mettant les dates côte à côte dans les cellules vertes. Pour cette mise en forme soit on décale dans la cellule de droite soit on met à la suite dans la même cellule.
Maintenant il me resterait à faire de même mais en repérant chaque type de congés CA (et CA N-1) CT, RTT, RF et en mettant les dates côte à côte dans les cellules vertes. Pour cette mise en forme soit on décale dans la cellule de droite soit on met à la suite dans la même cellule.
yg_be
13 avril 2018 à 13:09
- Messages postés
- 19998
- Date d'inscription
- lundi 9 juin 2008
- Statut
- Contributeur
- Dernière intervention
- 10 août 2022
13 avril 2018 à 13:09
suggestion:
Sub demcg() Dim fl As Worksheet Dim ligbl As Long, derlig As Long Dim cour As String, acc As String Set fl = ThisWorkbook.Sheets("Congé") derlig = fl.UsedRange.Rows(fl.UsedRange.Rows.Count).Row ligjn = 15 acc = "" For ligbl = 4 To derlig cour = fl.Cells(ligbl, 5) If cour <> "" Then If Left(cour, 1) <> " " Then If acc <> "" Then Call svcg(fl, acc) ligjn = ligjn + 1 End If acc = cour Else acc = acc & cour End If End If Next ligbl If acc <> "" Then Call svcg(fl, acc) End If End Sub Private Sub svcg(fl As Worksheet, conge As String) Dim tlig As Long Select Case Left(conge, 2) Case "CA" tlig = 24 Case "CT" tlig = 32 Case "RT" tlig = 40 Case "RF" tlig = 49 Case Else tlig = 57 End Select tcol = 10 Do While Cells(tlig, tcol) <> "" tcol = tcol + 1 Loop Cells(tlig, tcol) = conge End Sub
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre question
Saucisson_47
13 avril 2018 à 15:27
- Messages postés
- 11
- Date d'inscription
- vendredi 23 mars 2018
- Statut
- Membre
- Dernière intervention
- 13 avril 2018
13 avril 2018 à 15:27
Un grand merci à vous, c'est parfait!!!
Cdt
Cdt
yg_be
13 avril 2018 à 15:50
- Messages postés
- 19998
- Date d'inscription
- lundi 9 juin 2008
- Statut
- Contributeur
- Dernière intervention
- 10 août 2022
13 avril 2018 à 15:50
petites corrections:
option explicit Sub demcg() Dim fl As Worksheet Dim ligbl As Long, derlig As Long Dim cour As String, acc As String Set fl = ThisWorkbook.Sheets("Congé") derlig = fl.UsedRange.Rows(fl.UsedRange.Rows.Count).Row acc = "" For ligbl = 4 To derlig cour = fl.Cells(ligbl, 5) If cour <> "" Then If Left(cour, 1) <> " " Then If acc <> "" Then Call svcg(fl, acc) End If acc = cour Else acc = acc & cour End If End If Next ligbl If acc <> "" Then Call svcg(fl, acc) End If End Sub Private Sub svcg(fl As Worksheet, conge As String) Dim tlig As Long, tcol As Long Select Case Left(conge, 2) Case "CA" tlig = 24 Case "CT" tlig = 32 Case "RT" tlig = 40 Case "RF" tlig = 49 Case Else tlig = 57 End Select tcol = 10 Do While Cells(tlig, tcol) <> "" tcol = tcol + 1 Loop Cells(tlig, tcol) = conge End Sub