Welcome to VBAX yazidioubi. In this forum we wrap our code with code tags, please refer to the first line in my signature to see this. Now getting into your formula....
Can you tell us what majuscule means in your language because to us majuscule means Large letter or Uppercase. In fact it would be significantly more effective if you were to post a workbook with an example of the data you are using.
In relation to your vba codes. In the first function both Case 0 and Case 1 have the same values, is this correct or a typo?
In the second Function, I am struggling to understand the logic of your arguments here,
Cle_RIP = Right(Cle_RIP,10)
appears to be circular reference to me. Logically maybe if you had written
Cle_RIP1 = Right(Cle-RIP,10)
.
Anyway the next bit, not withstanding my point from above
Cle_RIP= Right(Cle_RIP,10)
If Cle-RIP = " " then
Cle-RIP = 0
could be better constructed as
If Cle_RIP <> "" Then
Cle_RIP= Right(Cle-RIP,10)
Else
Cle-RIP = 0
End If
Logically though, both of these will fail as the program will not know which Cle_RIP to use as the value. Hence the importance of to name values correctly.
Similarly the following should also fail
RIP = Cle_RIP * 100
RIP = RIP - 97 * INT(RIP/97)
RIP = RIP + 85
How does the program understand which RIP value to use and when?
Then you have added further confusion with the following
....
End If
RIP = RIP - 97
RIP = 97 + RIP
If RIP <10 then
RIP = 0 + RIP
Else
RIP = RIP
End If
How does the program know when and how to use the value RIP?
Secondly the next few lines could be simply written as
If RIP <10 Then
RIP = RIP
End If
Please attach a workbook with sample data to assist clearing up the confusion.