Intégration % lors d'un update
bonjour à tous,
dans ma base j'ai un onglet comportant des données et au sein d'une colonne des %
j'ai un formulaire permettant la visualisation des données mais désormais je mets en place le système d'update
dans mon form il apparait X% Achieved
aussi lors du systeme d'update je fais un simple
Replace(Del3_Achievements, "% Achieved", "")
pour ne garder que le nombre
seulement voila quand je l'intègre dans ma base c'est bien le chiffre qui apparaît mais est enregistré tel quel par excel sans le mettre en %
si je demande en vba à formater cela en % et que je tape 2 c'est alors 200% qui s'applique..
comment faire comprendre à excel que le chiffre indiqué doit être mis en pourcentage
dans ma base si je tape 2 dans la cellule ca rend bien 2%...
une idée svp?
merci
Bonjour Darkangel,
Pour Excel si tu inscris un chiffre ou nombre entier dans une cellule et que tu formates celui-ci après en %.
Il sera x 100. Donc 2, au départ sera au format standard puis ressortira à 200% lorsque le format passera en %.
Mais si tu reviens sur cette cellule et que tu retapes 2. Il affichera 2% car la cellule a été auparavant formatée en %.
Ce qui explique ton cas puisque ta colonne est déjà formatée en %.
Note qu'il est possible en VBA de "forcer" un Range en %. Exemple: Range("A1").NumberFormat = "0.0%"
Bonne continuation.
merci mais quand je teste et que j'ajoute apres l'update la ligne
Cells(Match, 11) correspondant à la cellule en question!
Cells(Match, 11).NumberFormat = "0.0%"
cela ne change rien
en gros je tape 2 ca mets 2 mais pas en % et on excel me dit de le convertir en nombre
et si je met 2% et bien ca fait bien 2% mais toujours à convertir en nombre...
je tourne en rond avec ce truc...
A nouveau,
Sans un minimum de fichier, il est moins facile de proposer une solution.
C'est ton formulaire qui manque pour voir le souci.
la macro concernée dans son ensemble
je fais le test sur le deliverable 3 en bas de code
en premiere partie tu as la récupération
avec la ligne concernant mon soucis plus loin
Achievements = Format(ici.Offset(0, 9), "0%") & " Achieved"
le case concerné est dans mon cas de test le 3
plus loin il y aura la macro d'insertion et de suppression fonctionnant nickel
mais le soucis est désormais lié à l'update
Private Sub Update_Del3_Click()
'************************************************************************
'************************************************************************
' DELIVERABLES DU PROJET
'************************************************************************
'************************************************************************
Private Sub Deliverables()
For i = 1 To 20
With Sheets("Deliverables")
ok = False
Set ici = .Range("B:B").Find(Acronym, LookIn:=xlValues)
If Not ici Is Nothing Then
prem = ici.Address
Do
If ici.Offset(0, -1) = (ProjectId & "_" & i) Then ok = True
If Not ok Then Set ici = .Range("B:B").FindNext(ici)
Loop While Not ici Is Nothing And ici.Address <> prem And Not ok
End If
If ok Then
Del_Nr = ici.Offset(0, 2)
Del_Name = ici.Offset(0, 3)
Del_PI = ici.Offset(0, 4)
Del_Start_month = "M " & ici.Offset(0, 5)
Del_Start_date = ici.Offset(0, 6)
Del_End_month = "M " & ici.Offset(0, 7)
Del_End_date = ici.Offset(0, 8)
Achievements = Format(ici.Offset(0, 9), "0%") & " Achieved"
Status = ici.Offset(0, 12)
Else
Del_Nr = ""
Del_Name = ""
Del_PI = ""
Del_Start_month = ""
Del_Start_date = ""
Del_End_month = ""
Del_End_date = ""
Achievements = ""
Status = ""
End If
End With
Select Case i
Case 1
Del1_Nr = Del_Nr
Del1_Name = Del_Name
Del1_PI = Del_PI
Del1_Start_month = Del_Start_month
Del1_Start_date = Del_Start_date
Del1_End_month = Del_End_month
Del1_End_date = Del_End_date
Del1_Achievements = Achievements
Del1_Status = Status
If Del1_Nr = "" Then
Del1_Nr_Label.Visible = False
Del1_Name_Label.Visible = False
Del1_PI_Label.Visible = False
Del1_Start_date_Label.Visible = False
Del1_Start_month_Label.Visible = False
Del1_End_date_Label.Visible = False
Del1_End_month_Label.Visible = False
Del1_Achievements_Label.Visible = False
Del1_Status_Label.Visible = False
Del1_Nr.Visible = False
Del1_Name.Visible = False
Del1_PI.Visible = False
Del1_Start_month.Visible = False
Del1_Start_date.Visible = False
Del1_End_month.Visible = False
Del1_End_date.Visible = False
Del1_Achievements.Visible = False
Del1_Status.Visible = False
Delete_Del1.Visible = False
Update_Del1.Visible = False
End If
Case 2
Del2_Nr = Del_Nr
Del2_Name = Del_Name
Del2_PI = Del_PI
Del2_Start_month = Del_Start_month
Del2_Start_date = Del_Start_date
Del2_End_month = Del_End_month
Del2_End_date = Del_End_date
Del2_Achievements = Achievements
Del2_Status = Status
If Del2_Nr = "" Then
Del2_Nr_Label.Visible = False
Del2_Name_Label.Visible = False
Del2_PI_Label.Visible = False
Del2_Start_date_Label.Visible = False
Del2_Start_month_Label.Visible = False
Del2_End_date_Label.Visible = False
Del2_End_month_Label.Visible = False
Del2_Achievements_Label.Visible = False
Del2_Status_Label.Visible = False
Del2_Nr.Visible = False
Del2_Name.Visible = False
Del2_PI.Visible = False
Del2_Start_month.Visible = False
Del2_Start_date.Visible = False
Del2_End_month.Visible = False
Del2_End_date.Visible = False
Del2_Achievements.Visible = False
Del2_Status.Visible = False
Delete_Del2.Visible = False
Update_Del2.Visible = False
End If
Case 3
Del3_Nr = Del_Nr
Del3_Name = Del_Name
Del3_PI = Del_PI
Del3_Start_month = Del_Start_month
Del3_Start_date = Del_Start_date
Del3_End_month = Del_End_month
Del3_End_date = Del_End_date
Del3_Achievements = Achievements
Del3_Status = Status
If Del3_Nr = "" Then
Del3_Nr_Label.Visible = False
Del3_Name_Label.Visible = False
Del3_PI_Label.Visible = False
Del3_Start_date_Label.Visible = False
Del3_Start_month_Label.Visible = False
Del3_End_date_Label.Visible = False
Del3_End_month_Label.Visible = False
Del3_Achievements_Label.Visible = False
Del3_Status_Label.Visible = False
Del3_Nr.Visible = False
Del3_Name.Visible = False
Del3_PI.Visible = False
Del3_Start_month.Visible = False
Del3_Start_date.Visible = False
Del3_End_month.Visible = False
Del3_End_date.Visible = False
Del3_Achievements.Visible = False
Del3_Status.Visible = False
Delete_Del3.Visible = False
Update_Del3.Visible = False
End If
Case 4
Del4_Nr = Del_Nr
Del4_Name = Del_Name
Del4_PI = Del_PI
Del4_Start_month = Del_Start_month
Del4_Start_date = Del_Start_date
Del4_End_month = Del_End_month
Del4_End_date = Del_End_date
Del4_Achievements = Achievements
Del4_Status = Status
If Del4_Nr = "" Then
Del4_Nr_Label.Visible = False
Del4_Name_Label.Visible = False
Del4_PI_Label.Visible = False
Del4_Start_date_Label.Visible = False
Del4_Start_month_Label.Visible = False
Del4_End_date_Label.Visible = False
Del4_End_month_Label.Visible = False
Del4_Achievements_Label.Visible = False
Del4_Status_Label.Visible = False
Del4_Nr.Visible = False
Del4_Name.Visible = False
Del4_PI.Visible = False
Del4_Start_month.Visible = False
Del4_Start_date.Visible = False
Del4_End_month.Visible = False
Del4_End_date.Visible = False
Del4_Achievements.Visible = False
Del4_Status.Visible = False
Delete_Del4.Visible = False
Update_Del4.Visible = False
End If
Case 5
Del5_Nr = Del_Nr
Del5_Name = Del_Name
Del5_PI = Del_PI
Del5_Start_month = Del_Start_month
Del5_Start_date = Del_Start_date
Del5_End_month = Del_End_month
Del5_End_date = Del_End_date
Del5_Achievements = Achievements
Del5_Status = Status
If Del5_Nr = "" Then
Del5_Nr_Label.Visible = False
Del5_Name_Label.Visible = False
Del5_PI_Label.Visible = False
Del5_Start_date_Label.Visible = False
Del5_Start_month_Label.Visible = False
Del5_End_date_Label.Visible = False
Del5_End_month_Label.Visible = False
Del5_Achievements_Label.Visible = False
Del5_Status_Label.Visible = False
Del5_Nr.Visible = False
Del5_Name.Visible = False
Del5_PI.Visible = False
Del5_Start_month.Visible = False
Del5_Start_date.Visible = False
Del5_End_month.Visible = False
Del5_End_date.Visible = False
Del5_Achievements.Visible = False
Del5_Status.Visible = False
Delete_Del5.Visible = False
Update_Del5.Visible = False
MultiPage1.Pages(3).ScrollHeight = MultiPage1.Pages(3).ScrollHeight - 69
End If
Case 6
Del6_Nr = Del_Nr
Del6_Name = Del_Name
Del6_PI = Del_PI
Del6_Start_month = Del_Start_month
Del6_Start_date = Del_Start_date
Del6_End_month = Del_End_month
Del6_End_date = Del_End_date
Del6_Achievements = Achievements
Del6_Status = Status
If Del6_Nr = "" Then
Del6_Nr_Label.Visible = False
Del6_Name_Label.Visible = False
Del6_PI_Label.Visible = False
Del6_Start_date_Label.Visible = False
Del6_Start_month_Label.Visible = False
Del6_End_date_Label.Visible = False
Del6_End_month_Label.Visible = False
Del6_Achievements_Label.Visible = False
Del6_Status_Label.Visible = False
Del6_Nr.Visible = False
Del6_Name.Visible = False
Del6_PI.Visible = False
Del6_Start_month.Visible = False
Del6_Start_date.Visible = False
Del6_End_month.Visible = False
Del6_End_date.Visible = False
Del6_Achievements.Visible = False
Del6_Status.Visible = False
Delete_Del6.Visible = False
Update_Del6.Visible = False
MultiPage1.Pages(3).ScrollHeight = MultiPage1.Pages(3).ScrollHeight - 69
End If
Case 7
Del7_Nr = Del_Nr
Del7_Name = Del_Name
Del7_PI = Del_PI
Del7_Start_month = Del_Start_month
Del7_Start_date = Del_Start_date
Del7_End_month = Del_End_month
Del7_End_date = Del_End_date
Del7_Achievements = Achievements
Del7_Status = Status
If Del7_Nr = "" Then
Del7_Nr_Label.Visible = False
Del7_Name_Label.Visible = False
Del7_PI_Label.Visible = False
Del7_Start_date_Label.Visible = False
Del7_Start_month_Label.Visible = False
Del7_End_date_Label.Visible = False
Del7_End_month_Label.Visible = False
Del7_Achievements_Label.Visible = False
Del7_Status_Label.Visible = False
Del7_Nr.Visible = False
Del7_Name.Visible = False
Del7_PI.Visible = False
Del7_Start_month.Visible = False
Del7_Start_date.Visible = False
Del7_End_month.Visible = False
Del7_End_date.Visible = False
Del7_Achievements.Visible = False
Del7_Status.Visible = False
Delete_Del7.Visible = False
Update_Del7.Visible = False
MultiPage1.Pages(3).ScrollHeight = MultiPage1.Pages(3).ScrollHeight - 69
End If
Case 8
Del8_Nr = Del_Nr
Del8_Name = Del_Name
Del8_PI = Del_PI
Del8_Start_month = Del_Start_month
Del8_Start_date = Del_Start_date
Del8_End_month = Del_End_month
Del8_End_date = Del_End_date
Del8_Achievements = Achievements
Del8_Status = Status
If Del8_Nr = "" Then
Del8_Nr_Label.Visible = False
Del8_Name_Label.Visible = False
Del8_PI_Label.Visible = False
Del8_Start_date_Label.Visible = False
Del8_Start_month_Label.Visible = False
Del8_End_date_Label.Visible = False
Del8_End_month_Label.Visible = False
Del8_Achievements_Label.Visible = False
Del8_Status_Label.Visible = False
Del8_Nr.Visible = False
Del8_Name.Visible = False
Del8_PI.Visible = False
Del8_Start_month.Visible = False
Del8_Start_date.Visible = False
Del8_End_month.Visible = False
Del8_End_date.Visible = False
Del8_Achievements.Visible = False
Del8_Status.Visible = False
Delete_Del8.Visible = False
Update_Del8.Visible = False
MultiPage1.Pages(3).ScrollHeight = MultiPage1.Pages(3).ScrollHeight - 69
End If
Case 9
Del9_Nr = Del_Nr
Del9_Name = Del_Name
Del9_PI = Del_PI
Del9_Start_month = Del_Start_month
Del9_Start_date = Del_Start_date
Del9_End_month = Del_End_month
Del9_End_date = Del_End_date
Del9_Achievements = Achievements
Del9_Status = Status
If Del9_Nr = "" Then
Del9_Nr_Label.Visible = False
Del9_Name_Label.Visible = False
Del9_PI_Label.Visible = False
Del9_Start_date_Label.Visible = False
Del9_Start_month_Label.Visible = False
Del9_End_date_Label.Visible = False
Del9_End_month_Label.Visible = False
Del9_Achievements_Label.Visible = False
Del9_Status_Label.Visible = False
Del9_Nr.Visible = False
Del9_Name.Visible = False
Del9_PI.Visible = False
Del9_Start_month.Visible = False
Del9_Start_date.Visible = False
Del9_End_month.Visible = False
Del9_End_date.Visible = False
Del9_Achievements.Visible = False
Del9_Status.Visible = False
Delete_Del9.Visible = False
Update_Del9.Visible = False
MultiPage1.Pages(3).ScrollHeight = MultiPage1.Pages(3).ScrollHeight - 69
End If
Case 10
Del10_Nr = Del_Nr
Del10_Name = Del_Name
Del10_PI = Del_PI
Del10_Start_month = Del_Start_month
Del10_Start_date = Del_Start_date
Del10_End_month = Del_End_month
Del10_End_date = Del_End_date
Del10_Achievements = Achievements
Del10_Status = Status
If Del10_Nr = "" Then
Del10_Nr_Label.Visible = False
Del10_Name_Label.Visible = False
Del10_PI_Label.Visible = False
Del10_Start_date_Label.Visible = False
Del10_Start_month_Label.Visible = False
Del10_End_date_Label.Visible = False
Del10_End_month_Label.Visible = False
Del10_Achievements_Label.Visible = False
Del10_Status_Label.Visible = False
Del10_Nr.Visible = False
Del10_Name.Visible = False
Del10_PI.Visible = False
Del10_Start_month.Visible = False
Del10_Start_date.Visible = False
Del10_End_month.Visible = False
Del10_End_date.Visible = False
Del10_Achievements.Visible = False
Del10_Status.Visible = False
Delete_Del10.Visible = False
Update_Del10.Visible = False
MultiPage1.Pages(3).ScrollHeight = MultiPage1.Pages(3).ScrollHeight - 69
End If
Case 11
Del11_Nr = Del_Nr
Del11_Name = Del_Name
Del11_PI = Del_PI
Del11_Start_month = Del_Start_month
Del11_Start_date = Del_Start_date
Del11_End_month = Del_End_month
Del11_End_date = Del_End_date
Del11_Achievements = Achievements
Del11_Status = Status
If Del11_Nr = "" Then
Del11_Nr_Label.Visible = False
Del11_Name_Label.Visible = False
Del11_PI_Label.Visible = False
Del11_Start_date_Label.Visible = False
Del11_Start_month_Label.Visible = False
Del11_End_date_Label.Visible = False
Del11_End_month_Label.Visible = False
Del11_Achievements_Label.Visible = False
Del11_Status_Label.Visible = False
Del11_Nr.Visible = False
Del11_Name.Visible = False
Del11_PI.Visible = False
Del11_Start_month.Visible = False
Del11_Start_date.Visible = False
Del11_End_month.Visible = False
Del11_End_date.Visible = False
Del11_Achievements.Visible = False
Del11_Status.Visible = False
Delete_Del11.Visible = False
Update_Del11.Visible = False
MultiPage1.Pages(3).ScrollHeight = MultiPage1.Pages(3).ScrollHeight - 69
End If
Case 12
Del12_Nr = Del_Nr
Del12_Name = Del_Name
Del12_PI = Del_PI
Del12_Start_month = Del_Start_month
Del12_Start_date = Del_Start_date
Del12_End_month = Del_End_month
Del12_End_date = Del_End_date
Del12_Achievements = Achievements
Del12_Status = Status
If Del12_Nr = "" Then
Del12_Nr_Label.Visible = False
Del12_Name_Label.Visible = False
Del12_PI_Label.Visible = False
Del12_Start_date_Label.Visible = False
Del12_Start_month_Label.Visible = False
Del12_End_date_Label.Visible = False
Del12_End_month_Label.Visible = False
Del12_Achievements_Label.Visible = False
Del12_Status_Label.Visible = False
Del12_Nr.Visible = False
Del12_Name.Visible = False
Del12_PI.Visible = False
Del12_Start_month.Visible = False
Del12_Start_date.Visible = False
Del12_End_month.Visible = False
Del12_End_date.Visible = False
Del12_Achievements.Visible = False
Del12_Status.Visible = False
Delete_Del12.Visible = False
Update_Del12.Visible = False
MultiPage1.Pages(3).ScrollHeight = MultiPage1.Pages(3).ScrollHeight - 69
End If
Case 13
Del13_Nr = Del_Nr
Del13_Name = Del_Name
Del13_PI = Del_PI
Del13_Start_month = Del_Start_month
Del13_Start_date = Del_Start_date
Del13_End_month = Del_End_month
Del13_End_date = Del_End_date
Del13_Achievements = Achievements
Del13_Status = Status
If Del13_Nr = "" Then
Del13_Nr_Label.Visible = False
Del13_Name_Label.Visible = False
Del13_PI_Label.Visible = False
Del13_Start_date_Label.Visible = False
Del13_Start_month_Label.Visible = False
Del13_End_date_Label.Visible = False
Del13_End_month_Label.Visible = False
Del13_Achievements_Label.Visible = False
Del13_Status_Label.Visible = False
Del13_Nr.Visible = False
Del13_Name.Visible = False
Del13_PI.Visible = False
Del13_Start_month.Visible = False
Del13_Start_date.Visible = False
Del13_End_month.Visible = False
Del13_End_date.Visible = False
Del13_Achievements.Visible = False
Del13_Status.Visible = False
Delete_Del13.Visible = False
Update_Del13.Visible = False
MultiPage1.Pages(3).ScrollHeight = MultiPage1.Pages(3).ScrollHeight - 69
End If
Case 14
Del14_Nr = Del_Nr
Del14_Name = Del_Name
Del14_PI = Del_PI
Del14_Start_month = Del_Start_month
Del14_Start_date = Del_Start_date
Del14_End_month = Del_End_month
Del14_End_date = Del_End_date
Del14_Achievements = Achievements
Del14_Status = Status
If Del14_Nr = "" Then
Del14_Nr_Label.Visible = False
Del14_Name_Label.Visible = False
Del14_PI_Label.Visible = False
Del14_Start_date_Label.Visible = False
Del14_Start_month_Label.Visible = False
Del14_End_date_Label.Visible = False
Del14_End_month_Label.Visible = False
Del14_Achievements_Label.Visible = False
Del14_Status_Label.Visible = False
Del14_Nr.Visible = False
Del14_Name.Visible = False
Del14_PI.Visible = False
Del14_Start_month.Visible = False
Del14_Start_date.Visible = False
Del14_End_month.Visible = False
Del14_End_date.Visible = False
Del14_Achievements.Visible = False
Del14_Status.Visible = False
Delete_Del14.Visible = False
Update_Del14.Visible = False
MultiPage1.Pages(3).ScrollHeight = MultiPage1.Pages(3).ScrollHeight - 69
End If
Case 15
Del15_Nr = Del_Nr
Del15_Name = Del_Name
Del15_PI = Del_PI
Del15_Start_month = Del_Start_month
Del15_Start_date = Del_Start_date
Del15_End_month = Del_End_month
Del15_End_date = Del_End_date
Del15_Achievements = Achievements
Del15_Status = Status
If Del15_Nr = "" Then
Del15_Nr_Label.Visible = False
Del15_Name_Label.Visible = False
Del15_PI_Label.Visible = False
Del15_Start_date_Label.Visible = False
Del15_Start_month_Label.Visible = False
Del15_End_date_Label.Visible = False
Del15_End_month_Label.Visible = False
Del15_Achievements_Label.Visible = False
Del15_Status_Label.Visible = False
Del15_Nr.Visible = False
Del15_Name.Visible = False
Del15_PI.Visible = False
Del15_Start_month.Visible = False
Del15_Start_date.Visible = False
Del15_End_month.Visible = False
Del15_End_date.Visible = False
Del15_Achievements.Visible = False
Del15_Status.Visible = False
Delete_Del15.Visible = False
Update_Del15.Visible = False
MultiPage1.Pages(3).ScrollHeight = MultiPage1.Pages(3).ScrollHeight - 69
End If
Case 16
Del16_Nr = Del_Nr
Del16_Name = Del_Name
Del16_PI = Del_PI
Del16_Start_month = Del_Start_month
Del16_Start_date = Del_Start_date
Del16_End_month = Del_End_month
Del16_End_date = Del_End_date
Del16_Achievements = Achievements
Del16_Status = Status
If Del16_Nr = "" Then
Del16_Nr_Label.Visible = False
Del16_Name_Label.Visible = False
Del16_PI_Label.Visible = False
Del16_Start_date_Label.Visible = False
Del16_Start_month_Label.Visible = False
Del16_End_date_Label.Visible = False
Del16_End_month_Label.Visible = False
Del16_Achievements_Label.Visible = False
Del16_Status_Label.Visible = False
Del16_Nr.Visible = False
Del16_Name.Visible = False
Del16_PI.Visible = False
Del16_Start_month.Visible = False
Del16_Start_date.Visible = False
Del16_End_month.Visible = False
Del16_End_date.Visible = False
Del16_Achievements.Visible = False
Del16_Status.Visible = False
Delete_Del16.Visible = False
Update_Del16.Visible = False
MultiPage1.Pages(3).ScrollHeight = MultiPage1.Pages(3).ScrollHeight - 69
End If
Case 17
Del17_Nr = Del_Nr
Del17_Name = Del_Name
Del17_PI = Del_PI
Del17_Start_month = Del_Start_month
Del17_Start_date = Del_Start_date
Del17_End_month = Del_End_month
Del17_End_date = Del_End_date
Del17_Achievements = Achievements
Del17_Status = Status
If Del17_Nr = "" Then
Del17_Nr_Label.Visible = False
Del17_Name_Label.Visible = False
Del17_PI_Label.Visible = False
Del17_Start_date_Label.Visible = False
Del17_Start_month_Label.Visible = False
Del17_End_date_Label.Visible = False
Del17_End_month_Label.Visible = False
Del17_Achievements_Label.Visible = False
Del17_Status_Label.Visible = False
Del17_Nr.Visible = False
Del17_Name.Visible = False
Del17_PI.Visible = False
Del17_Start_month.Visible = False
Del17_Start_date.Visible = False
Del17_End_month.Visible = False
Del17_End_date.Visible = False
Del17_Achievements.Visible = False
Del17_Status.Visible = False
Delete_Del17.Visible = False
Update_Del17.Visible = False
MultiPage1.Pages(3).ScrollHeight = MultiPage1.Pages(3).ScrollHeight - 69
End If
Case 18
Del18_Nr = Del_Nr
Del18_Name = Del_Name
Del18_PI = Del_PI
Del18_Start_month = Del_Start_month
Del18_Start_date = Del_Start_date
Del18_End_month = Del_End_month
Del18_End_date = Del_End_date
Del18_Achievements = Achievements
Del18_Status = Status
If Del18_Nr = "" Then
Del18_Nr_Label.Visible = False
Del18_Name_Label.Visible = False
Del18_PI_Label.Visible = False
Del18_Start_date_Label.Visible = False
Del18_Start_month_Label.Visible = False
Del18_End_date_Label.Visible = False
Del18_End_month_Label.Visible = False
Del18_Achievements_Label.Visible = False
Del18_Status_Label.Visible = False
Del18_Nr.Visible = False
Del18_Name.Visible = False
Del18_PI.Visible = False
Del18_Start_month.Visible = False
Del18_Start_date.Visible = False
Del18_End_month.Visible = False
Del18_End_date.Visible = False
Del18_Achievements.Visible = False
Del18_Status.Visible = False
Delete_Del18.Visible = False
Update_Del18.Visible = False
MultiPage1.Pages(3).ScrollHeight = MultiPage1.Pages(3).ScrollHeight - 69
End If
Case 19
Del19_Nr = Del_Nr
Del19_Name = Del_Name
Del19_PI = Del_PI
Del19_Start_month = Del_Start_month
Del19_Start_date = Del_Start_date
Del19_End_month = Del_End_month
Del19_End_date = Del_End_date
Del19_Achievements = Achievements
Del19_Status = Status
If Del19_Nr = "" Then
Del19_Nr_Label.Visible = False
Del19_Name_Label.Visible = False
Del19_PI_Label.Visible = False
Del19_Start_date_Label.Visible = False
Del19_Start_month_Label.Visible = False
Del19_End_date_Label.Visible = False
Del19_End_month_Label.Visible = False
Del19_Achievements_Label.Visible = False
Del19_Status_Label.Visible = False
Del19_Nr.Visible = False
Del19_Name.Visible = False
Del19_PI.Visible = False
Del19_Start_month.Visible = False
Del19_Start_date.Visible = False
Del19_End_month.Visible = False
Del19_End_date.Visible = False
Del19_Achievements.Visible = False
Del19_Status.Visible = False
Delete_Del19.Visible = False
Update_Del19.Visible = False
MultiPage1.Pages(3).ScrollHeight = MultiPage1.Pages(3).ScrollHeight - 69
End If
Case 20
Del20_Nr = Del_Nr
Del20_Name = Del_Name
Del20_PI = Del_PI
Del20_Start_month = Del_Start_month
Del20_Start_date = Del_Start_date
Del20_End_month = Del_End_month
Del20_End_date = Del_End_date
Del20_Achievements = Achievements
Del20_Status = Status
If Del20_Nr = "" Then
Del20_Nr_Label.Visible = False
Del20_Name_Label.Visible = False
Del20_PI_Label.Visible = False
Del20_Start_date_Label.Visible = False
Del20_Start_month_Label.Visible = False
Del20_End_date_Label.Visible = False
Del20_End_month_Label.Visible = False
Del20_Achievements_Label.Visible = False
Del20_Status_Label.Visible = False
Del20_Nr.Visible = False
Del20_Name.Visible = False
Del20_PI.Visible = False
Del20_Start_month.Visible = False
Del20_Start_date.Visible = False
Del20_End_month.Visible = False
Del20_End_date.Visible = False
Del20_Achievements.Visible = False
Del20_Status.Visible = False
Delete_Del20.Visible = False
Update_Del20.Visible = False
MultiPage1.Pages(3).ScrollHeight = MultiPage1.Pages(3).ScrollHeight - 69
End If
End Select
Next
End Sub
Private Sub Insert_Deliverable_Click()
InsertDeliverable.Acronym = Acronym
InsertDeliverable.ProjectId = ProjectId
InsertDeliverable.Show
End Sub
Private Sub Del3_Start_month_Enter()
Del3_Start_month = ""
End Sub
Private Sub Del3_End_month_Enter()
Del3_End_month = ""
End Sub
Private Sub Del3_Achievements_Enter()
Del3_Achievements = ""
End Sub
Private Sub Update_Del3_Click()
Match = Application.Match(ProjectId & "_3", Worksheets("Deliverables").Columns("A"), 0)
If MsgBox("Are you sure you want updating deliverable " & Del3_Nr & " in line " & Match, vbYesNo, "Confirmation") = vbNo Then Exit Sub
Del3_Start_month = Replace(Del3_Start_month, "M ", "")
Del3_End_month = Replace(Del3_End_month, "M ", "")
Del3_Achievements = Replace(Del3_Achievements, "% Achieved", "")
DelNew_Start_date = DateAdd("m", Del3_Start_month - 1, StartDate)
DelNew_End_date = DateAdd("m", Del3_End_month, StartDate) - 1
Cells(Match, 4) = Del3_Nr
Cells(Match, 5) = Del3_Name
Cells(Match, 6) = Del3_PI
Cells(Match, 7) = Del3_Start_month
Cells(Match, 8) = DelNew_Start_date
Cells(Match, 9) = Del3_End_month
Cells(Match, 10) = DelNew_End_date
Cells(Match, 11) = Del3_Achievements
UserForm_Relaunch
MultiPage1.Value = 3
End Sub
Private Sub Delete_Del3_Click()
Match = Application.Match(ProjectId & "_3", Worksheets("Deliverables").Columns("A"), 0)
If MsgBox("Are you sure you want deleting deliverable " & Del3_Nr & " in line " & Match, vbYesNo, "Confirmation") = vbNo Then Exit Sub
Rows(Match).EntireRow.Delete
UserForm_Relaunch
MultiPage1.Value = 3
End Sub
'************************************************************************
'************************************************************************
' FIN / DELIVERABLES DU PROJET
'************************************************************************
'************************************************************************
Suite,
Le mieux, fait un mini fichier (simple formulaire) avec ce qui pose souci afin qu'il puisse être tester sur l'ordi.
Car là c'est impossible.
Voila un fichier retraçant le soucis
j'ai réduit au max mais on voit le soucis
il y a 2% dans l'onglet mais quand on lance le form et que l'on met 2 dans achivement et que l'on clique sur l'icone verte pour effectuer l'update , le problème exact arrive...
merci par avance pour votre aide
A nouveau,
J'ai téléchargé ton mini-fichier et le regarde sous peu.
A suivre...
Bonjour à tous,
Chez moi avec saisie ce 2% ça s'affiche dans la feuille, mais en texte, pas en nombre.
Et si tu inverses tes 2 lignes en écrivant d'abord la cellule:
Cells(Line, 5) = CDbl(Val(Del1_Achievements) / 100)
Del1_Achievements = Replace(Del1_Achievements, "% Achieved", "")
je converti en numérique et je recalcule que tu aies 2% sur saisie de 2 ou de 2%.
eric
Edit : ah, désolé x cellus, je m'étais mis dessus
@ Eriiic,
Pas de souci, j'ai bien vu que dans les premières lignes du Private Sub le fait de contraindre le format pour l'affichage dans le textbox allait ressortir sur la feuille en format texte la cellule E2. Et lui faire perdre son format pourcentage.
Mais étonnament il affiche dans le menu Nombre Excel le critère Pourcentage.
Bon, de toute façon j'avais plutôt prévu de corriger cela demain. Trop sommeil.
A plus.
Bonjour Darkangel,
Rajoute en fin de ta ligne de code.
Cells(line, 5) = Dell_Acheviements & "%".
Ainsi tu forceras la cellule en % et non à rester en texte.
Bonne continuation.
Bonjour à vous deux,
j'ai tenté les différentes solutions
si j'ajoute la ligne Cells(Line, 5) = CDbl(Val(Del1_Achievements) / 100)
cela ne change rien au soucis
par contre si je mets comme proposé la ligne par X Cellus cela fonctionne bien
Cells(Line, 5) = Dell_Acheviements & "%"
merci à vous pour votre assitance!
je vais désormais implanter la solution dans mon fichier d'origine
je viens de tenter et cela fonctionne
merci à vous!
si j'ajoute la ligne Cells(Line, 5) = CDbl(Val(Del1_Achievements) / 100)
cela ne change rien au soucis
il faut bien sûr que la cellule soit au format pourcentage.
eric