signal change of cell contents and place 1 cell right

keithkemble

Board Regular
Joined
Feb 15, 2002
Messages
160
My objective is to be able to place an indicator 1 cell to the right of any cell that a user changes.

I can use the following but cannot determine what should replace the Target.Value > 100

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Target.Column = 1 Then
ThisRow = Target.Row
If Target.Value > 100 Then
Range("B" & ThisRow).Interior.ColorIndex = 3
Else
Range("B" & ThisRow).Interior.ColorIndex = xlColorIndexNone
End If
End If
End Sub

Any suggestions ?
Thanks
 

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
If all you are looking for is a change then do away with the value condition:

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Target.Column = 1 Then
ThisRow = Target.Row
Range("B" & ThisRow).Interior.ColorIndex = 3
Else
Range("B" & ThisRow).Interior.ColorIndex = xlColorIndexNone
End If
End Sub

Is this right?
Tom
 
Upvote 0
Keith, I'm not sure what you are looking for...
A) put an indicator right off any changed cell : you don't have to check the values
<pre>
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
Cells(Target.Row, Target.Column + 1).Interior.ColorIndex = 3
End Sub
</pre>

B) put an indicator only if the value > 100
<pre>
Private Sub Worksheet_Change(ByVal Target As Excel.Range)

If Target.Value > 100 Then
Cells(Target.Row, Target.Column + 1).Interior.ColorIndex = 3
Else
Cells(Target.Row, Target.Column + 1).Interior.ColorIndex = xlColorIndexNone
End If

End Sub
</pre>
 
Upvote 0

Forum statistics

Threads
1,214,839
Messages
6,121,887
Members
449,057
Latest member
Moo4247

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top