Active cell

colinharwood

Active Member
Joined
Jul 27, 2002
Messages
426
Office Version
  1. 2019
Platform
  1. Windows
Hi All

Is it possible to make the active cell remain in the centre of the screen, instead of waiting till it reaches the bottom of the screen and then moving the page up.

IE can the page scroll up each time a new row is entered

thanks

Colin
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
Whatever your selection by code, mouse or keyboard, this code will make the selected cell scroll to the upper left of the screen. When the code above this snipet selects a cell or activates the current selection. JSW

Application.Goto Selection, scroll:=True
 
Upvote 0
This Event code will automatically scroll the selection to the upper left of the screen. JSW

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
'Standard Module Code!
ActiveSheet.Select
Application.Goto Selection, scroll:=True
End Sub
 
Upvote 0
The code comment tells you its "Standard Module) code!

So with your question in mind, I gather you have not recorded a macro in Excel or know how to program?

Don't worry, just highlight the posted code, Right click it, select "Copy." Then open Excel, bring up a "New" Workbook. Right click the bottom sheet "Tab" lable. Select "View Code." From the now open VBA (Visual Basic Editor) toolbar select "Insert - Module."

On the blank code page, Right click and select "Paste." You should now have the code added to Excel.

Select the top Right close "X" on the display and you should return to the Excel worksheet. Add some test data and play with it and see if it does what you want?


Hope this helps? JSW
 
Upvote 0
Hi Joe

Thanks for that, I had been trying to insert it on an existing module without any luck

Colin
 
Upvote 0

Forum statistics

Threads
1,214,649
Messages
6,120,732
Members
448,987
Latest member
marion_davis

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