![]() |
Change colour of cells when content is altered/changed BUT NOT TO INSERTED OR DELETED ROWS
Hi
The group previously helped me with a code that changes the colour of cells when the content is edited/changed and it works well Thank you ================================================== = Private Sub Workbook_SheetChange(ByVal Sh As Object, _ ByVal Target As Range) Target.Interior.ColorIndex = 8 End Sub ========== What I would like is to further enhance the code so that it DOESN'T make a colour change to inserted or deleted rows, but still allows the cell colour change when the content is edited/changed Is this possible ? -- Martin ©¿©¬ |
Change colour of cells when content is altered/changed BUT NOT TO INSERTED OR DELETED ROWS
Private Sub Worksheet_Change(ByVal Target As Range)
With Target If .Cells.Count 1 Then Exit Sub If .Value < "" Then .Interior.ColorIndex = 8 End If End With End Sub Gord Dibben MS Excel MVP On Fri, 11 Apr 2008 17:21:37 GMT, Martin ©¿©¬ @nohere.net wrote: Hi The group previously helped me with a code that changes the colour of cells when the content is edited/changed and it works well Thank you ================================================= == Private Sub Workbook_SheetChange(ByVal Sh As Object, _ ByVal Target As Range) Target.Interior.ColorIndex = 8 End Sub ========== What I would like is to further enhance the code so that it DOESN'T make a colour change to inserted or deleted rows, but still allows the cell colour change when the content is edited/changed Is this possible ? |
Change colour of cells when content is altered/changed BUT NOT TO INSERTED OR DELETED ROWS
On Fri, 11 Apr 2008 15:24:15 -0700, Gord Dibben <gorddibbATshawDOTca
wrote: Private Sub Worksheet_Change(ByVal Target As Range) With Target If .Cells.Count 1 Then Exit Sub If .Value < "" Then .Interior.ColorIndex = 8 End If End With End Sub Thank you very much Gord This does a great job and saves a lot of extra work removing coloured lines the previous code left behind when inserting & deleting lines It's a great time saver -- Regards Martin ©¿©¬ |
Change colour of cells when content is altered/changed BUT NOT TO INSERTED OR DELETED ROWS
Good to hear.
Thanks for the feedback. Gord On Sat, 12 Apr 2008 10:23:19 GMT, Martin ©¿©¬ @nohere.net wrote: On Fri, 11 Apr 2008 15:24:15 -0700, Gord Dibben <gorddibbATshawDOTca wrote: Private Sub Worksheet_Change(ByVal Target As Range) With Target If .Cells.Count 1 Then Exit Sub If .Value < "" Then .Interior.ColorIndex = 8 End If End With End Sub Thank you very much Gord This does a great job and saves a lot of extra work removing coloured lines the previous code left behind when inserting & deleting lines It's a great time saver |
All times are GMT +1. The time now is 05:43 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com