Link to home
Start Free TrialLog in
Avatar of jmkbrown
jmkbrownFlag for United States of America

asked on

Dynamically select the last row in Excel

Good Morning,

I need to dynamically select the last row in an Excel spreadsheet, then I need to move this row to the top.

Thanks in advance
J Brown
Avatar of Martin Liss
Martin Liss
Flag of United States of America image

Sub MoveToTop()

    Rows(Cells(Rows.Count, 1).End(xlUp).Row).Cut
    Rows(1).Insert Shift:=xlDown

End Sub

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Rajesh Joshi
Rajesh Joshi
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jmkbrown

ASKER

Thank you very much.   This worked perfectly.  Sorry for the delay.