Attached is my code. It gives me a error when I open it. I had it working, saved it, closed it, and reopened and wal-la the error.
I dont know how to attach the whole spreadsheet, that might be best.
The jist of the code is to show two different pictures based on whats selected in the spreadsheet.
Private Sub Worksheet_Calculate()
HideSignals
Select Case [h1]
Case 1: Shapes("OSERIES1").Visible = msoTrue
Case 2: Shapes("BSERIES1").Visible = msoTrue
End Select
Select Case [h1]
Case 1: Shapes("OSERIES2").Visible = msoTrue
Case 2: Shapes("BSERIES2").Visible = msoTrue
End Select
Select Case [h1]
Case 1: Shapes("OSERIES3").Visible = msoTrue
Case 2: Shapes("BSERIES3").Visible = msoTrue
End Select
Select Case [h1]
Case 1: Shapes("OSERIES4").Visible = msoTrue
Case 2: Shapes("BSERIES4").Visible = msoTrue
End Select
Select Case [h1]
Case 1: Shapes("OSERIES5").Visible = msoTrue
Case 2: Shapes("BSERIES5").Visible = msoTrue
End Select
Select Case [h1]
Case 1: Shapes("OSERIES6").Visible = msoTrue
Case 2: Shapes("BSERIES6").Visible = msoTrue
End Select
Select Case [h1]
Case 1: Shapes("OSERIES7").Visible = msoTrue
Case 2: Shapes("BSERIES7").Visible = msoTrue
End Select
End Sub
Sub HideSignals()
Dim i As Integer
For i = 1 To 7
Shapes("OSERIES" & i).Visible = msoFalse
Shapes("BSERIES" & i).Visible = msoFalse
Next i
End Sub
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, [H2]) Is Nothing Then
'this does not calculate the worksheet. It just calls the Calculate event.
Worksheet_Calculate
End If
End Sub
I dont know how to attach the whole spreadsheet, that might be best.
The jist of the code is to show two different pictures based on whats selected in the spreadsheet.
Private Sub Worksheet_Calculate()
HideSignals
Select Case [h1]
Case 1: Shapes("OSERIES1").Visible = msoTrue
Case 2: Shapes("BSERIES1").Visible = msoTrue
End Select
Select Case [h1]
Case 1: Shapes("OSERIES2").Visible = msoTrue
Case 2: Shapes("BSERIES2").Visible = msoTrue
End Select
Select Case [h1]
Case 1: Shapes("OSERIES3").Visible = msoTrue
Case 2: Shapes("BSERIES3").Visible = msoTrue
End Select
Select Case [h1]
Case 1: Shapes("OSERIES4").Visible = msoTrue
Case 2: Shapes("BSERIES4").Visible = msoTrue
End Select
Select Case [h1]
Case 1: Shapes("OSERIES5").Visible = msoTrue
Case 2: Shapes("BSERIES5").Visible = msoTrue
End Select
Select Case [h1]
Case 1: Shapes("OSERIES6").Visible = msoTrue
Case 2: Shapes("BSERIES6").Visible = msoTrue
End Select
Select Case [h1]
Case 1: Shapes("OSERIES7").Visible = msoTrue
Case 2: Shapes("BSERIES7").Visible = msoTrue
End Select
End Sub
Sub HideSignals()
Dim i As Integer
For i = 1 To 7
Shapes("OSERIES" & i).Visible = msoFalse
Shapes("BSERIES" & i).Visible = msoFalse
Next i
End Sub
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, [H2]) Is Nothing Then
'this does not calculate the worksheet. It just calls the Calculate event.
Worksheet_Calculate
End If
End Sub