After code is run i am unable to use keyboard arrows to move from selected cell

ipbr21054

Well-known Member
Joined
Nov 16, 2010
Messages
5,832
Office Version
  1. 2007
Platform
  1. Windows
Ive had this before but searching old posts i was unable to find the answer.

I use the following code to select last row with value in column A

My issue is once im taken there i wish to use keyboard arrow to move up a cell or two but nothing happens.
Its as if its locked to that cell ??

I need to then select the cell.
Before the code advise did something that allowed me to use the keyboard arrows to move.

Can you advise please.



VBA Code:
Private Sub BottomOfPage_Click()
    Application.Goto Sheets("DATABASE").Range("A" & Rows.count).End(xlUp), True
    ActiveWindow.SmallScroll UP:=11
End Sub
 

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
No need for a Subroutine. Just hit CTR+FN+END then hit CTRL+HOME. Takes you to the first column of the last row. If your HOME and END key are not Function keys then I don't think you have to use FN.
 
Upvote 0
The button you are clicking is retaining the focus.
Try this
VBA Code:
Private Sub BottomOfPage_Click()
    Application.GoTo Sheets("DATABASE").Range("A" & Rows.Count).End(xlUp), True
    ActiveWindow.SmallScroll UP:=11
    ActiveCell.Select
End Sub
 
Upvote 0
Solution
@NoSparks that did the trick thanks.

In future if i find another i just need to add
VBA Code:
ActiveCell.Select
 
Upvote 0

Forum statistics

Threads
1,224,817
Messages
6,181,148
Members
453,021
Latest member
Justyna P

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