Hi,

I am getting this "Run-time error '1004: Method 'range' of object'_Global' failed" for the below code.Please advise.
Sub LastRow(control As IRibbonControl)
Dim LastCol As Variant
Set LastCol = Range("XFD" & ActiveCell.Row).End(xlToLeft)
    
    Application.GoTo Range(ActiveCell, LastCol)
End Sub
Thanks in advance!