Bonjour,
fais ce test avec le code sur un textbox, tu adapteras aux autres
1 2 3
| Private Sub Txt1_Change()
Txt1.Value = UCase(Txt1.Value)
End Sub |
edit : je ne pensais plus aux autres questions, je vais regarder
bonne journée
J'ai l'impression que tu as des erreurs et des variables non déclarées, rien que cette ligne
Cells(lig, i + 1).Value = Application.Proper(Me.Controls("Txt" & i).Value)
lig n'est pas déclaré et Application.Proper provoque les noms avec la première lettre en majuscule, le reste en minuscule, si tu veux tout en majuscule, sers-toi du code de mon post précédent ou change la ligne
Cells(lig, i + 1).Value = Ucase(Me.Controls("Txt" & i).Value)
Mainternant, pour ta 2ème question, je te propose (essayes en faisant une copie de ton fichier) ce code à la place de celui de ton bouton "supprimer"
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
| Private Sub CommandButton1_Click()
Dim derLig As Integer, cherche As Range, plage As Range
Application.ScreenUpdating = False
With Sheets("Base Données Coordo Licenciés")
derLig = .Range("a" & .Rows.Count).End(xlUp).Row
Set plage = .Range("a2:a" & derLig)
If Me.ComboBox1 <> "" And Me.ComboBox1 <> "New" Then
Set cherche = plage.Find(ComboBox1)
rep = MsgBox("Confirmez-vous la suppression de cet adhérent", vbYesNoCancel + vbDefaultButton2, "Suppression d'un adhérent")
If rep = 6 Then
.Range("b" & cherche.Row, "r" & cherche.Row).ClearContents
.Sort.SortFields.Clear
.Sort.SortFields.Add Key:=Range("B2"), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption _
:=xlSortTextAsNumbers
With .Sort
.SetRange Range("B2:R" & derLig)
.Header = xlNo
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
End If
End If
End With
Application.ScreenUpdating = True
End Sub |
et dis-moi le résultat
Partager