Is there a way to make users not to use mouse by writing some kind of code in Vba forcing them to enter data in cell by cell rather than using mouse to move around the spread sheet.
the only way that I can think of to do this is using the selection_change event for the resepctive worksheet. This solution does not look at mouse activity, and I dont think you can do stuff like that in VBA.
use the selection_change event to test whether the newly selected cell is adjacent to the last selected cell. In this way the user will have to move the selected cell with the keyboard or at least when using the mouse click on a cell next to the one currently selected. am I describing this well enough?
heres some code to try...
'\\***insert this line into a module
public rLastCell as range
'\\***these two procedures should sit inside the worksheet object code
Private Sub Worksheet_Activate()
Set rlastcell = Selection
End Sub
Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
If (Target.Row > rlastcell.Row + 1 Or Target.Row < rlastcell.Row - 1) _
Or (Target.Column > rlastcell.Column + 1 Or Target.Column < rlastcell.Column - 1) Then
'\\insert your required action here
rlastcell.Select
Else
Set rlastcell = Target
End If
End Sub
you need the code in the worksheet activate event to initialise rlast cell
of course you can mess with the code to make them go down rows or across columns or whatever...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.