Dim ligne As String Private Sub CommandButton1_Click() dernierligne Range("A" & ligne).Select 'derniere ligne Selection.Insert Shift:=xlDown 'inserer ligne au dessus ActiveCell.Offset(0, 0).Select 'selectionner ligne ActiveCell.FormulaR1C1 = TextBox1.Text 'saisie du texte End Sub 'Chercher la dernière ligne de la colonne A Function LastRow() 'feuille active, colonne A LastRow = Cells(Cells.Rows.Count, "A").End(xlUp).Row End Function Sub dernierligne() ligne = LastRow End Sub
Dim ligne As String Private Sub CommandButton1_Click() dernierligne Range("B" & ligne).Select 'derniere ligne Selection.Insert Shift:=xlDown 'inserer ligne au dessus ActiveCell.Offset(0, 1).Select 'selectionner ligne (0 =ligne, 1=colonne) ActiveCell.FormulaR1C1 = TextBox1.Text 'saisie du texte ActiveCell.Offset(0, 1).Select 'selectionner ligne ActiveCell.FormulaR1C1 = TextBox2.Text 'saisie du texte ActiveCell.Offset(0, 1).Select 'selectionner ligne ActiveCell.FormulaR1C1 = TextBox3.Text 'saisie du texte ActiveCell.Offset(0, 1).Select 'selectionner ligne ActiveCell.FormulaR1C1 = TextBox4.Text 'saisie du texte End Sub 'Chercher la dernière ligne de la colonne B Function LastRow() 'feuille active, colonne B LastRow = Cells(Cells.Rows.Count, "B").End(xlUp).Row End Function Sub dernierligne() ligne = LastRow End Sub
Dim ligne As String Private Sub CommandButton1_Click() dernierligne Range("B" & ligne).Select 'derniere ligne Selection.Insert Shift:=xlDown 'inserer ligne au dessus ActiveCell.Offset(0, -1).Select 'selectionner ligne (0 =ligne, 1=colonne)-1 colonne à gauche de B = A ActiveCell.FormulaR1C1 = TextBox1.Text 'saisie du texte ActiveCell.Offset(0, 2).Select 'selectionner même ligne 2 colonne à droite de A = C ActiveCell.FormulaR1C1 = TextBox2.Text 'saisie du texte ActiveCell.Offset(0, 1).Select 'selectionner mêmeligne 1 colonne à droite de C = D ActiveCell.FormulaR1C1 = TextBox3.Text 'saisie du texte ActiveCell.Offset(0, 3).Select 'selectionner mêmeligne 3 colonne à droite de D = G ActiveCell.FormulaR1C1 = TextBox4.Text 'saisie du texte End Sub 'Chercher la dernière ligne de la colonne B Function LastRow() 'feuille active, colonne B LastRow = Cells(Cells.Rows.Count, "B").End(xlUp).Row End Function Sub dernierligne() ligne = LastRow End Sub
Dim ligne As String Private Sub CommandButton1_Click() dernierligne Range("A" & ligne).Select ActiveCell.Offset(1, 0).Select ActiveCell.FormulaR1C1 = TextBox1.Text End Sub 'Chercher la dernière ligne de la colonne A Function LastRow() 'feuille active, colonne A LastRow = Cells(Cells.Rows.Count, "A").End(xlUp).Row End Function Sub dernierligne() ligne = LastRow End Sub
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre question