Hi,
Is it possible to center on a scroll area?
The attached workbook runs a macro on sheet 1 that centers the range Z30 to AO30 on the screen width, but I'd also like to lock the scroll area so one cannot scroll past Z30:AO100. The two seem to conflict and debug is they are both in action. Any ideas?
TX
Workbook attached...
Center on Scroll Area
-
- gamma jay
- Posts: 25455
- Joined: 17 Mar 2010, 17:33
- Location: Cape Town
Center on Scroll Area
You do not have the required permissions to view the files attached to this post.
Regards,
Rudi
If your absence does not affect them, your presence didn't matter.
Rudi
If your absence does not affect them, your presence didn't matter.
-
- Administrator
- Posts: 78474
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Center on Scroll Area
You could use
to avoid the conflict (which is caused by the argument .Scroll = True of Application.GoTo).
Code: Select all
Private Sub Worksheet_Activate()
ActiveSheet.ScrollArea = ""
CenterOnCellND Range("Z30:AO30")
ActiveSheet.ScrollArea = "$Z$30:$AQ$100"
End Sub
Best wishes,
Hans
Hans
-
- gamma jay
- Posts: 25455
- Joined: 17 Mar 2010, 17:33
- Location: Cape Town
Re: Center on Scroll Area
HA!!!
So simple....So elegant....
TX
So simple....So elegant....
TX
Regards,
Rudi
If your absence does not affect them, your presence didn't matter.
Rudi
If your absence does not affect them, your presence didn't matter.