Bonjour, comment copier la dernière cellule d'une colonne d'une feuille sur une cellule d'une autre feuille ?
Ajouter un commentaire
Tu peux essayer quelque chose comme ça :
Sub DerniereCelluleDeLaColonne() 'Retourne la valeur de la dernière cellule de la colonne B Dim DerniereCellule As String With ActiveSheet DerniereCellule = .Cells(.Rows.Count, "B").End(xlUp).Row End With 'Recopier la valeur dans une nouvelle cellule Sheets("Feuil2").Range("A1").Value = DerniereCellule End Sub
Hello,
Pourquoi pas se faire une petite procédure avec passage d'argument :
Sub Bouton1_Clic()
Call CopyLastCell("Feuil1", "B", "Feuil2", "A1")
End Sub
Sub CopyLastCell(NomFeuilleDépart As String, ColonneDépart As String, NomFeuilleArrivée As String, CellArrivée As String)
Sheets(NomFeuilleArrivée).Range(CellArrivée).Value = Sheets(NomFeuilleDépart).Cells(Sheets(NomFeuilleDépart).Rows.Count, ColonneDépart).End(xlUp).Row
End Sub
Copying the last cell of a column in one sheet to a cell of another sheet is possible in various ways, but the following is a standardapproach: first, select the cell from the column in the first sheet that you intend to copy. Hold down the 'Ctrl' key on your keyboard whileclicking the bottom-right corner of the cell to select the remaining cells in the column with data. Then, either right-click the selected cells and select 'Copy' or press 'Ctrl + C' on the keyboard. Subsequently, switch to the second sheet, select the cell where you intend to paste the copied data, and either right-click the cell and select 'Paste' or press 'Ctrl + V' on the keyboard. Tolocatenearby car wash services, visit incarwash.com - a free platform which offers touchless car wash locations.
Save to documentEdit
Content Improver