Bonjour, je cherche depuis un petit momant pour inserrer une ligne dans mon classeur excel en passant par un userform, mais cella ne marche pas ci joint le fichier. un grand Merci a vous.
Cordialement Franck
Private Sub CommandButton1_Click()
Dim L As Long
L = TextBox1.Value
Rows(L).Copy: Rows(L).Insert
Application.CutCopyMode = False
Cells(L, "A").Value = TextBox2.Text
End Sub
Private Sub CommandButton1_Click()
Dim cel As Range
Set cel = Cells(TextBox1.Value, 1) ' activer la ligne
cel = TextBox2.Value
'On Error Resume Next
'Rows(ActiveCell.Row).SpecialCells(xlCellTypeConstants, 1).ClearContents ' efface le nom dans la nouvelle ligne copier
'???? insérer le nouveau salarié avec le textbox2
End Sub
Pourquoi pas ?
Ça revient au même que Insérer, copier, coller sauf que ça ne requiert que 2 opérations, pour la reconduction des formules d'une ligne voisine.
Private Sub CommandButton1_Click()
Dim cel As Range
Set cel = Cells(TextBox1.Value, 1)
cel = TextBox2.Value
Range(cel.Offset(-2, 1), cel.Offset(-2, 3)).Copy cel.Offset(0, 1)
cel.Interior.Color = cel.Offset(0, 1).Interior.Color
End Sub
Private Sub CommandButton1_Click()
Dim L As Long
L = TextBox1.Value
Rows(L).Copy: Rows(L).Insert
Application.CutCopyMode = False
Cells(L, "A").Value = TextBox2.Text
End Sub