Bonjour,
J'ai un probleme avec cette macro, elle est censee decremente le commentaire de 1. Mais il y a une erreur de definition d application ou de definition d objet. Voici la ligne qui pose probleme :
Private Sub CmdAdd_Click()
Dim test As String
If ComboBoxHostname.Text <> "" And TextBoxComment.Text <> "" And ComboBoxStatut.Text <> "" Then
a = 2
Do While Cells(1, a).Value <> ComboBoxHostname.Text
a = a + 1
Loop
i = 8
Do While Cells(i, a).Value <> ""
i = i + 1
Loop
Worksheets("INV").Cells(i, a).Value = LblDate.Caption
t = 6
Do While Cells(t, 1).Value <> ComboBoxStatut.Text
t = t + 1
Loop
Worksheets("INV").Cells(i, a).Interior.ColorIndex = Cells(t, 1).Interior.ColorIndex
Worksheets("INV").Cells(i, a).ClearComments
Worksheets("INV").Cells(i, a).Select
Worksheets("INV").Cells(i, a).AddComment
Worksheets("INV").Cells(i, a).Comment.Visible = False
Worksheets("INV").Cells(i, a).Comment.Text Text:=TextBoxComment.Text
If ComboBoxStatut.Text = "Consumables" And ComboBoxHostname.Text <> "" Then
u = 2
Do While Worksheets("stock").Cells(u, 1).Value <> ComboBoxConsu.Text
u = u + 1
Loop
Worksheets("stock").Range("A", u).Comment.Text Text:=Val(Worksheets("stock").Range("A", u).Comment.Text) - 1
End If
Unload UserForm1
25 nov. 2008 à 12:33
End If
Utilmiser & pour concatener
Patrick