ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Highlight a cell after update in a specific range (https://www.excelbanter.com/excel-programming/448641-highlight-cell-after-update-specific-range.html)

Mark[_71_]

Highlight a cell after update in a specific range
 
Hallo to everybody,

I am tryng to write few Vba lines to highlight a cell after update.
I am using this code, but it doesn't work, either no error message.

Can you please help me? Thanks

Private Sub Worksheet_Change(ByVal Target As Range)
Dim Rng1 As Range
Dim Rng2 As Range

Set Rng1 = Range("K7:K1500") ' Column("K:K")
Set Rng2 = Intersect(Rng1, Target)

If Target.Count 1 Then Exit Sub
If Target.Column < Rng2 Then Exit Sub
Columns(Rng2).Interior.ColorIndex = xlNone
Target.Interior.ColorIndex = 6
End Sub

Regards
Mark

Claus Busch

Highlight a cell after update in a specific range
 
Hi Mark,

Am Thu, 25 Apr 2013 10:11:21 +0200 schrieb Mark:

I am tryng to write few Vba lines to highlight a cell after update.
I am using this code, but it doesn't work, either no error message.


try:
Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, Range("K7:K1500")) Is Nothing _
Or Target.Count 1 Then Exit Sub

Range("K7:K1500").Interior.ColorIndex = xlNone
Target.Interior.ColorIndex = 6
End Sub


Regards
Claus Busch
--
Win XP PRof SP2 / Vista Ultimate SP2
Office 2003 SP2 /2007 Ultimate SP2

Mark[_71_]

Highlight a cell after update in a specific range
 

Hi Claus,
this is perfect!

Thanks
Regards
Mark


All times are GMT +1. The time now is 03:46 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com