SanjayGMusafir
Well-known Member
- Joined
- Sep 7, 2018
- Messages
- 1,513
- Office Version
- 2024
- Platform
- Windows
Hi Experts
I have multiple tables on one sheet. The following Macro works fine on the first table of the sheet. But when it comes to using it on the any other table of the sheet, it misfires.
Please help
Thanks a lot
I have multiple tables on one sheet. The following Macro works fine on the first table of the sheet. But when it comes to using it on the any other table of the sheet, it misfires.
Please help
Thanks a lot
VBA Code:
Sub GoTableLast()
'
' GoTableLast Macro
'
'
Call GoHome
'Range(ActiveCell, ActiveCell.End(xlToRight)).Select
ActiveCell.Offset(-1, 0).End(xlToRight).Select
'ActiveCell.End(xlDown).Select
Dim LRow As Long, LCol As Long
LCol = ActiveCell.Column
'To get last row ignoring blank rows in a column
LRow = Columns(LCol).Find("*", SearchDirection:=xlPrevious, _
SearchOrder:=xlByRows, LookIn:=xlValues).Row
'To go to last active row of the same Active column
'Cells(LRow, LCol).Select
Cells(LRow, LCol).End(xlDown).End(xlDown).End(xlUp).Offset(0, -1).Select
End Sub