Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Cursor Movement
The following code words fine, as long as Excel is set to move the cursor to
the right after hitting enter. If I enter something however and hit the cursor up, down, or to the left, the code obviously doesn't work. How do I rewrite this code so that regardless of whether a user has set Excel to move right, left, up, or down after enter (or does so manually), it still works? My intent is that for the activecell in Col K, if what the user enters is the value in Col I (same row), then verbiage is entered on the same row, in Col L. If the value is <= Col I (same row), any verbiage on the same row in Col L is cleared. Thanks for any assistance that can be provided. Option Explicit Private Sub Worksheet_Change(ByVal Target As Range) If Not (Intersect(Target, Range("$K$8:$K$65000")) Is Nothing) Then If Target.Value ActiveCell.Offset(0, -3) Then ActiveCell.Offset(0, 0) = "DELEGATION LEVEL EXCEEDED!" ActiveCell.Font.ColorIndex = 3 End If If Target.Value = ActiveCell.Offset(0, -3) Then ActiveCell.Offset(0, 0).ClearContents End If If Target.Value < ActiveCell.Offset(0, -3) Then ActiveCell.Offset(0, 0).ClearContents End If End If End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
cursor movement | New Users to Excel | |||
CURSOR MOVEMENT | Excel Discussion (Misc queries) | |||
Cursor Movement? | Excel Worksheet Functions | |||
cursor movement | Excel Discussion (Misc queries) | |||
Movement of cursor | Excel Worksheet Functions |