I have a spreadsheet, when you pull down a menu, you can select two options that will change a picture in a spreadsheet. It was working, but now I get a error thats "Compile Error, cant find project or library"
Heres the code. not sure what to do.
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
Heres the code. not sure what to do.
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