is it possible to place active cell at center of screen? I have this code which places it at top part of screen...

sadams1

Board Regular
Joined
Aug 19, 2006
Messages
219
Thank you for taking time to consider this question! The following is a useful macro to place the active cell at the top of the screen but wanted to see if, instead, the active cell could be placed in center.


Sub cellTopLeft()
'
' topLeft Macro
'
' Keyboard Shortcut: Ctrl+Shift+L
'

Application.Goto ActiveCell, Scroll:=True
End Sub
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
How would you have cell A2 in the center of the screen if it was the Activecell?
 
Upvote 0
Sorry about not being more concise or including some screenshots. Attached are 2 screenshots that show the initial active cell F28 at the lower part of the screen & then repositioned more toward the center. Most of the spreadsheets I work with have thousands of rows & the active cell, or more precisely, the row of the active cell, gets parked somewhere way off the screen. I know various ways to do this but the code in my initial post makes getting the active cell to the top part of screen quick & easy & I wanted to see if something similar could get the active cell positioned more toward middle of screen.
 

Attachments

  • Screenshot 2024-02-24 085645.png
    Screenshot 2024-02-24 085645.png
    128 KB · Views: 8
  • Screenshot 2024-02-24 090029.png
    Screenshot 2024-02-24 090029.png
    132.8 KB · Views: 8
Upvote 0
You could try something like
VBA Code:
Sub ScrollTo()
If ActiveCell.Row > 13 Then ActiveWindow.ScrollRow = ActiveCell.Row - 13
End Sub
 
Upvote 0
Solution

Forum statistics

Threads
1,215,090
Messages
6,123,061
Members
449,091
Latest member
ikke

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