Greetings, All. I am a VBA rookie and cannot get multiple types of changes to occur at once. Could someone offer an assist?
I am trying to compile multiple fashions of data into one visual dashboard. Shape rotations are good to go, but color changing objects (the second part) aren't working for me. Cell references are good, but code doesn't like the way that I typed it.
Here is my code:
Private Sub Worksheet_Change(ByVal Target As Range)
ActiveSheet.Shapes.Range(<wbr>Array("Main_Cluster_Dial")).<wbr>Select
Selection.ShapeRange.Rotation = Range("CQ1").Value * 260
ActiveSheet.Shapes.Range(<wbr>Array("Main_Cluster_Dial_<wbr>Secondary")).Select
Selection.ShapeRange.Rotation = Range("CQ2").Value * 260
ActiveSheet.Shapes.Range(<wbr>Array("Left_Cluster_Dial")).<wbr>Select
Selection.ShapeRange.Rotation = Range("R34").Value * 201
ActiveSheet.Shapes.Range(<wbr>Array("Right_Cluster_Dial")).<wbr>Select
Selection.ShapeRange.Rotation = Range("CP12").Value * -201
ActiveSheet.Shapes.Range(<wbr>Array("Fuel_Gauge")).Select
Selection.ShapeRange.Rotation = Range("CP8").Value * 118
ActiveCell.Select
If Intersect(Target, Range("R34")) Is Nothing Then Exit Sub
If IsNumeric(Target.Value) Then
If Target.Value < 0.9 Then
ActiveSheet.Shapes("CSI_<wbr>Blinker").Fill.ForeColor.RGB = vbRed
ElseIf Target.Value >= 0.9 And Target.Value < 0.95 Then
ActiveSheet.Shapes("CSI_<wbr>Blinker").Fill.ForeColor.RGB = vbYellow
Else
ActiveSheet.Shapes("CSI_<wbr>Blinker").Fill.ForeColor.RGB = vbGreen
End If
End If
End Sub
Any advice would be appreciated!
JP
I am trying to compile multiple fashions of data into one visual dashboard. Shape rotations are good to go, but color changing objects (the second part) aren't working for me. Cell references are good, but code doesn't like the way that I typed it.
Here is my code:
Private Sub Worksheet_Change(ByVal Target As Range)
ActiveSheet.Shapes.Range(<wbr>Array("Main_Cluster_Dial")).<wbr>Select
Selection.ShapeRange.Rotation = Range("CQ1").Value * 260
ActiveSheet.Shapes.Range(<wbr>Array("Main_Cluster_Dial_<wbr>Secondary")).Select
Selection.ShapeRange.Rotation = Range("CQ2").Value * 260
ActiveSheet.Shapes.Range(<wbr>Array("Left_Cluster_Dial")).<wbr>Select
Selection.ShapeRange.Rotation = Range("R34").Value * 201
ActiveSheet.Shapes.Range(<wbr>Array("Right_Cluster_Dial")).<wbr>Select
Selection.ShapeRange.Rotation = Range("CP12").Value * -201
ActiveSheet.Shapes.Range(<wbr>Array("Fuel_Gauge")).Select
Selection.ShapeRange.Rotation = Range("CP8").Value * 118
ActiveCell.Select
If Intersect(Target, Range("R34")) Is Nothing Then Exit Sub
If IsNumeric(Target.Value) Then
If Target.Value < 0.9 Then
ActiveSheet.Shapes("CSI_<wbr>Blinker").Fill.ForeColor.RGB = vbRed
ElseIf Target.Value >= 0.9 And Target.Value < 0.95 Then
ActiveSheet.Shapes("CSI_<wbr>Blinker").Fill.ForeColor.RGB = vbYellow
Else
ActiveSheet.Shapes("CSI_<wbr>Blinker").Fill.ForeColor.RGB = vbGreen
End If
End If
End Sub
Any advice would be appreciated!
JP