Hi,
I have below 2 codes in the same workbooksheet. When i try to run it gives me Compile error: Ambiguous name detected: Worksheet_Change error for the second code. Is there a way to combine these 2 codes of fix the error message
I have below 2 codes in the same workbooksheet. When i try to run it gives me Compile error: Ambiguous name detected: Worksheet_Change error for the second code. Is there a way to combine these 2 codes of fix the error message
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim R1 As Range, R2 As Range, R3 As Range, R4 As Range
Set R1 = Range("CG1")
Set R2 = Range("CF1")
Set R3 = Range("E2")
Set R4 = Range("D2")
If R1.Value = 1 Then
R3.Interior.Color = vbWhite
ElseIf R2.Value = 1 Then
R4.Interior.Color = vbWhite
Else
R3.Interior.Color = 6
End If
End Sub
Code:
[B]Private Sub Worksheet_Change(ByVal Target As Range)[/B]
ActiveSheet.Shapes.Range(Array("Group42")).Select
Selection.ShapeRange.Rotation = Range("D10").Value * 245
ActiveCell.Select
End Sub