bonjour les amis,excuse moi avec beaucoup de questions je suis le debutant en VB.
menant j'ai une question concernant comment je peux entrer les données dans defferent colonnes dans l'excel sheet en utilisant seulement un seul textbox dans le userform en considarant les condition,si par exemple le mot se termine avec "er" doit se place dans la colonne A si se termine avec "tion" doit aller dans la colonne B ainsi de suite. voici ce que j'ai essayé de faire.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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
Private Sub cmdAdd_Click()
Dim iRow As Long
Dim ws As Worksheet
Set ws = Worksheets("amajyi")
 
iRow = ws.Cells(Rows.Count, 1) _
  .End(xlUp).Offset(1, 0).Row
 
  If Right(txtkiny.Text, 3) = "umu" Or "umw" Then
  ws.Cells(iRow, 1).Value = Me.txtkiny.Value
  If Right(txtkiny.Text, 3) = "imi" Or "imy" Then
  ws.Cells(iRow, 3).Value = Me.txtkiny.Value
   If Right(txtkiny.Text, 3) = "iri" Or "iry" Then
   ws.Cells(iRow, 4).Value = Me.txtkiny.Value
   If Right(txtKinyiny.Text, 1) = "i" Then
   ws.Cells(iRow, 4).Value = Me.txtkiny.Value
    If Right(txtkiny.Text, 3) = "ama" Then
    ws.Cells(iRow, 5).Value = Me.txtkiny.Value
    If Right(txtkiny, 2).Value = "am" Then
    ws.Cells(iRow, 5).Value = Me.txtkiny.Value
     If Right(txtkiny.Text, 3) = "imi" Or "imy" Then
     ws.Cells(iRow, 6).Value = Me.txtkiny.Value
      If Right(txtkiny.Text, 3) = "iki" Or "icy" Or "igi" Then
      ws.Cells(iRow, 7).Value = Me.txtkiny.Value
       If Right(txtkiny.Text, 3) = "ibi" Or "ibyi" Then
       ws.Cells(iRow, 8).Value = Me.txtkiny.Value
        If Right(txtkiny.Text, 1) = "i" Then
        ws.Cells(iRow, 9).Value = Me.txtkiny.Value
         If Right(txtkiny.Text, 2) = "in" Then
         ws.Cells(iRow, 10).Value = Me.txtkiny.Value
        If Right(txtkiny.Text, 3) = "inz" Then
        ws.Cells(iRow, 10).Value = Me.txtkiny.Value
         If Right(txtkiny.Text, 3) = "uru" Or "urw" Then
         ws.Cells(iRow, 11).Value = Me.txtkiny.Value
         If Right(txtkiny.Text, 3) = "aka" Or "aga" Then
         ws.Cells(iRow, 12).Value = Me.txtkiny.Value
         If Right(txtkiny.Text, 2) = "ak" Then
           ws.Cells(iRow, 13).Value = Me.txtkiny.Value
         If Right(txtkiny.Text, 3) = "utu" Or "utw" Or "udu" Then
         ws.Cells(iRow, 14).Value = Me.txtkiny.Value
         If Right(txtkiny.Text, 3) = "ubu" Or "ubw" Then
         ws.Cells(iRow, 14).Value = Me.txtkiny.Value
         If Right(txtkiny.Text, 3) = "uku" Or "ukw" Or "ugu" Then
         ws.Cells(iRow, 15).Value = Me.txtkiny.Value
 
Me.txtkiny.Value = ""
 
End Sub