View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Harald Staff[_2_] Harald Staff[_2_] is offline
external usenet poster
 
Posts: 449
Default Direction of entry to a cell

Hi Nathan

Why don't you simply lock the column and protect the sheet so that the
column can't be selected ?

Otherwise, sure, just compare to the previous target:

' *********** top of module ****************
Dim PrevTarget As Range

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Not PrevTarget Is Nothing Then
If Target(1).Column PrevTarget(1).Column Then
Application.StatusBar = "-"
ElseIf Target(1).Column < PrevTarget(1).Column Then
Application.StatusBar = "<-"
Else
Application.StatusBar = "-"
End If
End If
Set PrevTarget = Target
End Sub

Now look in Excels lower left corner when arrowing around.

HTH. Best wishes Harald

"nathan_savidge" wrote in message
...
Hi,

I am using the worksheet.selectionchange to skip a column of data, so if
the
user enters the column (with a calculation in that is not to be changed)
the
column after is selected, cells(target.row,target.column+1). This works
fine, from left to right, but from right to left, it just sticks at the
column you were in.

Is there a way of determining the direction that a cell is entered from?
So
i can do +1 or -1 based on this.

TIA

Nathan.