Floating Button that takes you back to last data entry row

mjg060468

New Member
Joined
Aug 25, 2010
Messages
26
Hi guys

I am creating a spreadsheet that will get used daily throughout the year. This means that the spreadsheet could get very long.

Therefore I am looking for a way to create two floating buttons, one to take you back to the top and another that takes you to the last row where data was entered.

Can anyone please help me?

Cheers
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
Create the buttons and assign each to the appropriate macro.
Code:
Sub Top()
    Cells(1, 1).Select
End Sub

Sub Bottom()
    Cells(Cells.Find("*", SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row + 1, 1).Select
End Sub
 
Last edited:
Upvote 0
Thanks for that. Unfortunately, I have drop down menus, and its sending me to the last line without a dropdown, therefore taking me to the very bottom of the spreadsheet, which isn't necessarily the last row of inputted data
 
Upvote 0
Sub Bottom()
Cells(Cells.Find("*", SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row + 1, 1).Select
End Sub

To counter the issue of dropdowns, any chance you could re-work this to search the next blank cell in column C, as that column has no dropdowns

Cheers
 
Upvote 0
Try:
Code:
Sub Bottom()
    Dim lastRow As Long
    With ActiveSheet.Cells.SpecialCells(xlCellTypeConstants)
        lastRow = .Cells(.Cells.Count).Row + 1
        Cells(lastRow, 1).Select
    End With
End Sub
 
Upvote 0
@mumps
That is going to count all cells with a constant in the entire sheet, not just those in col C.

Try like this
Code:
Sub Bottom()
    Dim lastRow As Long
    With ActiveSheet.Columns(3).SpecialCells(xlCellTypeConstants)
        lastRow = .Cells.Count
        Cells(lastRow, 1).Select
    End With
End Sub
Alternatively
Code:
Sub Bottom()
    Range("C" & Rows.Count).End(xlUp).Offset(, -2).Select
End Sub
 
Upvote 0
@Fluff: Thank you. I posted the code before seeing the PO's last post.
 
Upvote 0

Forum statistics

Threads
1,223,231
Messages
6,170,884
Members
452,364
Latest member
springate

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top