How do I turn scroll lock off (2007 excel)? No scroll lock key

C

Cameron A Perth

The keyboards we use don't have a scroll lock button and someone has somehow
accidentally turned the scroll lock on and the arrows now move the whole
sheet instead of between cells.

Can't seem to locate short cut or command to turn scroll lock off.

Thanks
 
K

KC

Righ Click on worksheet (say sheet1), then click on View Code.

paste the below code

'Begaining of the code
Private Declare Sub keybd_event Lib "user32.dll" _
(ByVal bVk As Byte, ByVal bScan As Byte, _
ByVal dwFlags As Long, ByVal dwExtraInfo As Long)

Private Declare Sub Sleep Lib "kernel32" _
(ByVal dwMilliseconds As Long)

Const VK_SCROLL = &H91
Const KEYEVENTF_KEYUP = &H2

Private Sub myScroll_Lock()
keybd_event VK_SCROLL, 0, 0, 0 'Press Scroll Lock
keybd_event VK_SCROLL, 0, KEYEVENTF_KEYUP, 0 'Release Scroll Lock
End Sub
'end of the code

now go back to your excel sheet and goto Macros (Alt+F8), and run
myScroll_Lock
everytime you run this function the scroll lock will toggle.

-kc
*Click YES if this works
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top