Howdy.
I've been researching and looking for a neat way to avoid users zooming, panning and scrolling. So far, refering to zoom, I found ways of "fixing" it, after a given action (change selection)
The code I'm actually using is the following (inside the specific worksheet's, that i want to lock, code). The worksheet I want to lock is called "DASHBOARD"
What I don't get is that, even with the logical test of the worksheet's name before any action and the code itself being inside the worksheet, I can't restrain the code to only one sheet. It "fixes" the zoom on every active worksheet.
Another thing I'm unhappy with is that I've lost the "Ctrl+Z" function. I get that macros can't be undone via "Ctrl+Z", but is there any other way around?
Anyway, thanks in advance!
I've been researching and looking for a neat way to avoid users zooming, panning and scrolling. So far, refering to zoom, I found ways of "fixing" it, after a given action (change selection)
The code I'm actually using is the following (inside the specific worksheet's, that i want to lock, code). The worksheet I want to lock is called "DASHBOARD"
Code:
Private Sub Worksheet_Activate()
If ActiveSheet.Name = "DASHBOARD" Then
ActiveWindow.Zoom = 100
Range("A1").Activate
End If
End Sub
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Sheets("DASHBOARD").ScrollArea = "A1:BK100"
If ActiveSheet.Name = "DASHBOARD" Then
Do
If ActiveWindow.Zoom <> 100 Then
ActiveWindow.Zoom = 100
End If
DoEvents
Loop While True
End If
End Sub
What I don't get is that, even with the logical test of the worksheet's name before any action and the code itself being inside the worksheet, I can't restrain the code to only one sheet. It "fixes" the zoom on every active worksheet.
Another thing I'm unhappy with is that I've lost the "Ctrl+Z" function. I get that macros can't be undone via "Ctrl+Z", but is there any other way around?
Anyway, thanks in advance!