PDA

View Full Version : Solved: Keep selected cell centred



John Poole
04-06-2010, 05:23 PM
Hi all, I'm hoping someone can point me in the right direction. Is thier any setting in Excel, or simple VBA code which will keep the selected cell centred in the middle of the screen? Ideally somethng which will scroll the screen as the user cursors around? Any help appreciated.

herzberg
04-06-2010, 09:36 PM
How about using the freeze pane option? Go to Windows>Freeze Panes. That will keep a section of the spreadsheet static but the user is able to scroll around.

p45cal
04-07-2010, 01:50 AM
right-click on the sheet in question's tab, coose View Code.. and paste this where the cursor is flashing:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
ActiveWindow.ScrollRow = Application.Max(1, ActiveCell.Row - 10)
ActiveWindow.ScrollColumn = Application.Max(1, ActiveCell.Column - 8)
End SubAdjust the 8 and 10 to suit.

John Poole
04-07-2010, 05:42 PM
Many thanks, that works for me!