Private Sub Worksheet_SelectionChange(ByVal Target As Range)
RowPos = Target.Row
ColPos = 3
' If Shift Key selected then
' Put an "x" in cell row = RowPos and Column = ColPos
ThisWorkbook.ActiveSheet.Cells(RowPos, ColPos) = "x"
'End If
End Sub
Is this code you got from somewhere or a guess on how it might look? I
think it would be better is you explained exactly what you want to do and to
what range because if you put an X into a cell everytime you move the cursor
with the SHIFT ALT or CTRL key down you may get some unpleasent supprises.
--
Thanks,
Shane Devenshire
Private Declare Function GetAsyncKeyState Lib "user32" ( _
ByVal vKey As Long) As Integer
Function ShiftCtrl() As Boolean
If GetAsyncKeyState(vbKeyControl) Then
ShiftCtrl = GetAsyncKeyState(vbKeyShift)
End If
End Function
' the above could go in a normal module and called from other object modules
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim RowPos As Long, ColPos As Long
If Target.Count = 1 Then
If ShiftCtrl Then
RowPos = Target.Row
ColPos = 3
Cells(RowPos, ColPos) = "x"
End If
End If
End Sub
> ThisWorkbook.ActiveSheet.Cells(RowPos, ColPos) = "x"
No need to qualify the sheet in the sheet module unless you want to refer to
some other sheet.
If you need to know more than simply Ctrl+Shift I'm sure you can adapt the
above for your needs.
Regards,
Peter T
"dwinmac" <dwi...@discussions.microsoft.com> wrote in message
news:54D2C7B8-848C-4905...@microsoft.com...