ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Highlighting whole row in this macro (https://www.excelbanter.com/excel-programming/391328-highlighting-whole-row-macro.html)

[email protected]

Highlighting whole row in this macro
 
Can I add something to this so that when the A1:A100 field is changed,
the whole row (A-L) is highlighted ColorIndex 6?

Dim x, cl

Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, Range("A1:A100")) Is Nothing Then Exit Sub
Target.Offset(0, 1) = x
Target.Interior.ColorIndex = 6
End Sub

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
x = ActiveCell.Value
End Sub


Dave Peterson

Highlighting whole row in this macro
 
Check your other post.

wrote:

Can I add something to this so that when the A1:A100 field is changed,
the whole row (A-L) is highlighted ColorIndex 6?

Dim x, cl

Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, Range("A1:A100")) Is Nothing Then Exit Sub
Target.Offset(0, 1) = x
Target.Interior.ColorIndex = 6
End Sub

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
x = ActiveCell.Value
End Sub


--

Dave Peterson


All times are GMT +1. The time now is 10:04 PM.

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