bonjour à tous
je n'arrive pas à trouver l'erreur de ce code qui ouvre un useform afin d'ajouter une ligne d'éléments dans un tableau
le problème est que l'ajout se fait toujours à la ligne 26 au lieu de se faire en fin de tableau
merci de votre aide
kinel
voici le code:
Private Sub CommandButton1_Click()
Application.ScreenUpdating = False
Dim derligne
Dim pos
Sheets("Liste").Select
derligne = Sheets(1).Range("A65536").End(xlUp).End(xlUp).Row + 1
If TextBox1.Value = "" Then
Label14.Visible = True
Exit Sub
End If
If TextBox2.Value = "" Then
Label14.Visible = True
Exit Sub
End If
If TextBox3.Value = "" Then
Label14.Visible = True
Exit Sub
End If
If TextBox4.Value = "" Then
Label14.Visible = True
Exit Sub
End If
If TextBox5.Value = "" Then
Label14.Visible = True
Exit Sub
End If
If TextBox6.Value = "" Then
Label14.Visible = True
Exit Sub
End If
Range("A" & derligne).Value = TextBox1.Value
Range("b" & derligne).Value = TextBox2.Value
Range("c" & derligne).Value = TextBox3.Value
Range("d" & derligne).Value = TextBox4.Value
Range("e" & derligne).Value = TextBox5.Value
Range("g" & derligne).Value = TextBox6.Value
Range("s" & derligne).Value = DTPicker1.Value
TextBox1.Value = ""
TextBox2.Value = ""
TextBox3.Value = ""
TextBox4.Value = ""
TextBox5.Value = ""
TextBox6.Value = ""
Label14.Visible = False
Application.ScreenUpdating = True
End Sub
je n'arrive pas à trouver l'erreur de ce code qui ouvre un useform afin d'ajouter une ligne d'éléments dans un tableau
le problème est que l'ajout se fait toujours à la ligne 26 au lieu de se faire en fin de tableau
merci de votre aide
kinel
voici le code:
Private Sub CommandButton1_Click()
Application.ScreenUpdating = False
Dim derligne
Dim pos
Sheets("Liste").Select
derligne = Sheets(1).Range("A65536").End(xlUp).End(xlUp).Row + 1
If TextBox1.Value = "" Then
Label14.Visible = True
Exit Sub
End If
If TextBox2.Value = "" Then
Label14.Visible = True
Exit Sub
End If
If TextBox3.Value = "" Then
Label14.Visible = True
Exit Sub
End If
If TextBox4.Value = "" Then
Label14.Visible = True
Exit Sub
End If
If TextBox5.Value = "" Then
Label14.Visible = True
Exit Sub
End If
If TextBox6.Value = "" Then
Label14.Visible = True
Exit Sub
End If
Range("A" & derligne).Value = TextBox1.Value
Range("b" & derligne).Value = TextBox2.Value
Range("c" & derligne).Value = TextBox3.Value
Range("d" & derligne).Value = TextBox4.Value
Range("e" & derligne).Value = TextBox5.Value
Range("g" & derligne).Value = TextBox6.Value
Range("s" & derligne).Value = DTPicker1.Value
TextBox1.Value = ""
TextBox2.Value = ""
TextBox3.Value = ""
TextBox4.Value = ""
TextBox5.Value = ""
TextBox6.Value = ""
Label14.Visible = False
Application.ScreenUpdating = True
End Sub