Bonjour,
pour un projet de facturation, je cherche a inscrire la valeur du TextBox3 dans la colonne J, si le mois et le numéro de projet sont respecté.
Alors TextBox1 = numéro de projet, TextBox2 = année et mois (sous format aaaa-mm).
Comment inclure ces 2 conditions dans ce programme?
Merci pour votre aide!
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 Private Sub CommandButton2_Click() projet = UserForm4.TextBox1.Value 'Date = UserForm4.TextBox2.Value If projet = "" Then Exit Sub Set c = [B:B].Find(projet, , , xlWhole) If Not c Is Nothing Then premier = c.Address Do c.Offset(0, 8).Value = UserForm4.TextBox3.Value Set c = [B:B].FindNext(c) Loop While Not c Is Nothing And c.Address <> premier End If Unload UserForm4 End Sub
Partager