1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
| Public VBComp As VBComponent, Cmd As CodeModule, Mdl As String, NomMacro As String
Public Texte1 As String, Titre1 As String
Public Texte2 As String, Titre2 As String
Public b As Integer, c As Integer, d As Integer, e As Integer
Public f As Integer, L As Integer, x As Integer
Public NewLine As String, solde As Integer
Sub rajout()
Mdl = "Mod_Types"
NomMacro = "Types"
Texte1 = "Veuillez choisir le ou les mots clés dans cette opération :"
Titre1 = "Définition du mot clé"
Texte2 = "Choisissez une catégorie pour cette opération"
Titre2 = "Choix de la catégorie"
Types
x = 3
e = 5
b = 2
Do Until Cells(x, 1) = ""
If Cells(x, e) = Empty Then
reponse1 = InputBox(Texte1, Titre1, Cells(x, b))
reponse2 = InputBox(Texte2, Titre2)
NewLine = " if cells(x, b) like ""*" & reponse1 & "*"" then cells(x, e) = """ & reponse2 & """"
With ThisWorkbook.VBProject.VBComponents(Mdl).CodeModule
L = .CountOfLines - 2
.InsertLines L, NewLine
End With
Types
Else: x = x + 1
End If
Loop
End Sub
Sub Types()
x = 3
e = 5
b = 2
Do Until Cells(x, 1) = ""
If Cells(x, b) Like "*CB*" Then Cells(x, e) = "CB"
If Cells(x, b) Like "*PRELEVEMENT AXA*" Then Cells(x, e) = "Assurance"
If Cells(x, b) Like "*VIREMENT*" Then Cells(x, e) = "Virement"
x = x + 1
Loop
End Sub |
Partager