Keep activecell in the center of the screen
During a Power Excel VBA class at the University of Akron, Carl asked: How can I keep the active cell in the center of the screen? We were working on Event Handlers at the time, and were able to build this useful bit of code:
Add this code to the worksheet event for the sheet:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
x = Target.Row
If x > 12 Then
ActiveWindow.ScrollRow = x - 10
End If
End Sub

<< Home