Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Worksheet_Change
Is there a way to tell what row and column you just left that was changed?
Greg |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Worksheet_Change
Greg
The WorkSheet_Change event has a Target Parameter. When a cell is changed you can test Target.Row and Target.Column. Search the archives for WorkSheet_Change; you should find lots of examples. One example for colouring cells dependent on their value: Private Sub Worksheet_Change(ByVal Target As Range) If Target.Count 1 Then Exit Sub If Target.Row < 3 Then Exit Sub If Not IsNumeric(Target.Value) Then Exit Sub Select Case Int(Target.Value) Case 1: Target.Interior.ColorIndex = 3 'red Case 2: Target.Interior.ColorIndex = 36 'amber/yellow Case 3: Target.Interior.ColorIndex = 27 'amber/dark yellow Case 4: Target.Interior.ColorIndex = 4 'green Case 5: Target.Interior.ColorIndex = 10 'dark green Case Else: Target.Interior.ColorIndex = xlNone End Select End Sub Regards Trevor "Greg Bloom" wrote in message news:2Acqb.113315$Fm2.101544@attbi_s04... Is there a way to tell what row and column you just left that was changed? Greg |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Sub Worksheet_Change | Excel Discussion (Misc queries) | |||
Worksheet_Change | Excel Worksheet Functions | |||
Worksheet_change won't run | Excel Discussion (Misc queries) | |||
worksheet_change vs. calculate, and worksheet_change not running | Excel Programming | |||
worksheet_change vs. calculate, and worksheet_change not running | Excel Programming |