Mrrrr's Forum (VIEW ONLY)
Un forum care ofera solutii pentru unele probleme legate in general de PC. Pe langa solutii, aici puteti gasi si alte lucruri interesante // A forum that offers solutions to some PC related issues. Besides these, here you can find more interesting stuff.
|
Lista Forumurilor Pe Tematici
|
Mrrrr's Forum (VIEW ONLY) | Reguli | Inregistrare | Login
POZE MRRRR'S FORUM (VIEW ONLY)
Nu sunteti logat.
|
Nou pe simpatie: Profil sarmaluta2002
 | Femeie 25 ani Bucuresti cauta Barbat 25 - 50 ani |
|
TRaP
Moderator
Inregistrat: acum 6 ani
Postari: 795
|
|
I wanted to create an arrow shape and assign to it a macro to go to last used cell in the selected column.
Assuming you select a cell in column C and click the arrow button, you should go to last used cell / first unused cell in column C.
The following code goes to last used cell in column (equivalent to CTRL+DOWN ARROW press):
Sub GoToLastUsedCell()
Dim LastCell As String
LastCell = ActiveCell.End(xlDown).Address LastCell = Range(LastCell).Select
End Sub |
Modificat de TRaP (acum 6 ani)
|
|
pus acum 6 ani |
|
TRaP
Moderator
Inregistrat: acum 6 ani
Postari: 795
|
|
More complicated code:
Sub GoToLastRowCell()
Dim c As Range Dim LastRow, colNum As Long
With ActiveSheet Set c = Selection colNum = c.Columns.Column LastRow = .Cells(Rows.Count, colNum).End(xlUp).Row .Cells(LastRow, colNum).Select End With
End Sub
|
NOTE: IF YOU ARE USING A TABLE, IT WILL GO TO THE LAST CELL IN THE TABLE, NOT THE LAST CELL WITH DATA
|
|
pus acum 6 ani |
|