Greetings, I have been using this code to change a shape color and it works fine, but now instead of the same workbook/worksheet I would like to source it from a different workbook. I am having trouble referencing that second workbook, every one I have tried has errored out. So I am thinking that the problem is my syntax. Could anyone show me the syntax to get it to reference the following workbook? Thank you
"'L:\CommonRW\[FacilitiesApps.xlsm]Coding'!$E7"
"'L:\CommonRW\[FacilitiesApps.xlsm]Coding'!$E7"
VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, Range("F7")) Is Nothing Then Exit Sub
If IsNumeric(Target.Value) Then
If Target.Value = 3 Then
ActiveSheet.Shapes("Rectangle 2").Fill.ForeColor.RGB = vbRed
ElseIf Target.Value = 2 Then
ActiveSheet.Shapes("Rectangle 2").Fill.ForeColor.RGB = vbYellow
Else
ActiveSheet.Shapes("Rectangle 2").Fill.ForeColor.RGB = vbGreen
End If
End If
End Sub