I am having a problem getting a worksheet change macro to run. I have range B1:B6 that is toggled between 1 and 2 by way of a radio button. The worksheet change macro runs fine if I manually input a value. And the macro I try to run through the worksheet change macro runs fine if I run it manually. But I can not get it to run using the radio buttons. Below are the two macros I am dealing with. Any help would be much appreciated and thanks to all of you on Mr Excel again.
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim KeyCells As Range
Set KeyCells = Worksheets("Sheet1").Range("B1:B6")
If Not Application.Intersect(KeyCells, Range(Target.Address)) Is Nothing Then
Call Update_Pick
End If
End Sub
[code]
[code]Sub Update_Pick()
Application.ScreenUpdating = False
Worksheets("Sheet1").Unprotect
Worksheets("Sheet1").Range("C1:C6").Calculate
If Worksheets("Sheet1").Range("B1") = 1 Then
Worksheets("Sheet1").Range("D19").Interior.Color = RGB(255, 0, 0)
Else
Worksheets("Sheet1").Range("D19").Interior.Color = RGB(0, 128, 0)
End If
If Worksheets("Sheet1").Range("B2") = 1 Then
Worksheets("Sheet1").Range("H19").Interior.Color = RGB(255, 0, 0)
Else
Worksheets("Sheet1").Range("H19").Interior.Color = RGB(0, 128, 0)
End If
If Worksheets("Sheet1").Range("B3") = 1 Then
Worksheets("Sheet1").Range("L19").Interior.Color = RGB(255, 0, 0)
Else
Worksheets("Sheet1").Range("L19").Interior.Color = RGB(0, 128, 0)
End If
If Worksheets("Sheet1").Range("B4") = 1 Then
Worksheets("Sheet1").Range("P19").Interior.Color = RGB(255, 0, 0)
Else
Worksheets("Sheet1").Range("P19").Interior.Color = RGB(0, 128, 0)
End If
If Worksheets("Sheet1").Range("B5") = 1 Then
Worksheets("Sheet1").Range("T19").Interior.Color = RGB(255, 0, 0)
Else
Worksheets("Sheet1").Range("T19").Interior.Color = RGB(0, 128, 0)
End If
If Worksheets("Sheet1").Range("B6") = 1 Then
Worksheets("Sheet1").Range("X19").Interior.Color = RGB(255, 0, 0)
Else
Worksheets("Sheet1").Range("X19").Interior.Color = RGB(0, 128, 0)
End If
Worksheets("Sheet1").Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
Application.ScreenUpdating = True
End Sub
[code]