VijayNewtoExcel
New Member
- Joined
- Dec 14, 2024
- Messages
- 3
- Office Version
- 365
I want to go the cell of the last row of a particular column where the value has been entered. Can you please provide VBA Code/.
Thanks a lot. It worked...This macro applies to the active sheet.
VBA Code:Sub SelectLastRow() Dim lCol As Long lCol = ActiveCell.Column Cells(Rows.Count, lCol).End(xlUp).Select End Sub
Superb....It worked....Appreciate your quick responseSub GoToLastCellInColumn()
Dim ws As Worksheet
Dim lastRow As Long
Dim targetColumn As String
' Set your worksheet and target column
Set ws = ThisWorkbook.Sheets("Sheet1") ' Change "Sheet1" to your sheet name
targetColumn = "A" ' Change "A" to your desired column
' Find the last row in the target column with data
With ws
lastRow = .Cells(.Rows.Count, targetColumn).End(xlUp).Row
' Select the last cell in the column
.Cells(lastRow, targetColumn).Select
End With
End Sub