Active cell

colinharwood

Active Member
Joined
Jul 27, 2002
Messages
397
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

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.

Joe Was

MrExcel MVP
Joined
Feb 19, 2002
Messages
7,539
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
 

Joe Was

MrExcel MVP
Joined
Feb 19, 2002
Messages
7,539
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
 

colinharwood

Active Member
Joined
Jul 27, 2002
Messages
397
Office Version
  1. 2019
Platform
  1. Windows

ADVERTISEMENT

Hi Joe

Thanks for that, but where exactly do I put the code?

Colin
 

Joe Was

MrExcel MVP
Joined
Feb 19, 2002
Messages
7,539
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
 

colinharwood

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

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

Colin
 

Forum statistics

Threads
1,144,220
Messages
5,723,085
Members
422,477
Latest member
pete101

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
Top