Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ' =================================================================================================
- ' Cle CCP | By BOUSSAID
- ' =================================================================================================
- Private Function CCP(x As String)
- Dim TCCP1(1 To 15) As Integer
- Dim IND As Integer
- J = 0
- For IND = 1 To Len(x)
- TCCP1(IND) = Mid(x, IND, 1)
- Next
- For IND = 4 To 4 + Len(x) - 1
- ac = ac + (TCCP1(Len(x) - J) * IND)
- J = J + 1
- Next
- ac = Right(ac, 2)
- 'tcptxt = ac & " Clé " & tcptxt
- CCP = ac
- End Function
- ' =================================================================================================
- ' CLE & RIP CCP | Usage: =Cle_CCP_RIP(1;A1) & =Cle_CCP_RIP(2;A1)
- ' =================================================================================================
- Public Function Paie_Cle_CCP_RIP(Type_Cle As Integer, Compte_CCP As String) As String
- Dim nResulta As Integer
- Select Case Type_Cle
- '1 = Cle CCP
- Case 1
- nResulta = CLng(CCP(Compte_CCP))
- '2 = Cle Rip
- Case 2
- nResulta = (97 - ((((CLng(Compte_CCP) Mod 97) * (3 Mod 97)) + 85) Mod 97))
- Case Else
- nResulta = 0
- End Select
- 'ADD "0" Like 01, 02, 03 ... etc
- Paie_Cle_CCP_RIP = CStr(Format(nResulta, "00")) 'CStr(nResulta)
- End Function
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement