ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Scroll locked in multiple worksheets (https://www.excelbanter.com/excel-programming/331818-scroll-locked-multiple-worksheets.html)

Mac

Scroll locked in multiple worksheets
 
How can I get the cursor to remain in the same position when using multiple
worksheets?
For example, all worksheets start in cell A5 nad then if I move to A10, all
worksheets go to A10 and so on.

GaryDK[_2_]

Scroll locked in multiple worksheets
 
Hi Mac,

Paste this into the ThisWorkbook module. It should do the trick.

Option Explicit

Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, _
ByVal Target As Range)

Dim ws As Worksheet

Application.ScreenUpdating = False
Application.EnableEvents = False

For Each ws In Worksheets
ws.Activate
ws.Range(Target.Address).Activate
Next ws

Sh.Activate
Application.EnableEvents = True

End Sub
Regards,

Gary


GaryDK[_2_]

Scroll locked in multiple worksheets
 
Sorry, Mac! I read your request as cell selection, not scrolling.
That's a different problem. If I have more time, I'll post something if
nobody answers your question.

Gary


Mac

Scroll locked in multiple worksheets
 
Gary, thanks for the info. i will try it.
Mac

"GaryDK" wrote:

Hi Mac,

Paste this into the ThisWorkbook module. It should do the trick.

Option Explicit

Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, _
ByVal Target As Range)

Dim ws As Worksheet

Application.ScreenUpdating = False
Application.EnableEvents = False

For Each ws In Worksheets
ws.Activate
ws.Range(Target.Address).Activate
Next ws

Sh.Activate
Application.EnableEvents = True

End Sub
Regards,

Gary




All times are GMT +1. The time now is 09:30 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com