I am including a sample file that can illustrate what I have working so far.
I basically want to watch multiple cells, and if their values change,(by comparing them to the Check sheet), code will execute.
I want to watch cells on (sheet Working Data, rows 24 & 25, cells B-BJ.) and compare them to (sheet Check, rows 24 & 25, cells B-BJ).
It works great for the sigle test cell B2, but I now want to watch multiple cells.
File Attached:
Thanks for any help, sugesstions.
Dan
Sheet2 Working Data:
Code
Private Sub Worksheet_Calculate()
Worksheet_Change Range("B24")
End Sub
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
Dim checkStr As String
checkStr = Sheets("Check").Range("B24")
' Level 1: Set up the event to watch a single cell.
If Target.Address = Range("B24").Address Then
' Level 2: Perform some action based on the value of the watched cell.
Select Case Target.Value
Case Is <> checkStr
Target.Font.ColorIndex = 2
With Target.Interior
.ColorIndex = 3
.Pattern = xlSolid
End With
Range("A3:A6").Select
Selection.Font.ColorIndex = 2
With Selection.Interior
.ColorIndex = 3
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
Range("B24").Select
End With
Case Is = checkStr
Target.Font.ColorIndex = 5
With Target.Interior
.ColorIndex = xlColorIndexNone
.Pattern = xlPatternNone
End With
End Select
End If
End Sub
Module1:
Sub GoalSeekQuick2()
Sheets("working data").Select
Range("A3:A6").Select
Selection.Font.ColorIndex = 10
With Selection.Interior
.ColorIndex = 10
.Pattern = xlSolid
End With
Rows("24:25").Select
Selection.Interior.ColorIndex = xlNone
Selection.Font.ColorIndex = 5
Selection.Copy
Sheets("Check").Select
Range("A24").Select
ActiveSheet.Paste
Range("A1").Select
Sheets("working data").Select
ActiveWindow.SmallScroll Down:=-1
Range("A1").Select
Application.CutCopyMode = False
Range("B24").Select
MsgBox "test macro executed"
End Sub
Display More