m_in_spain
Board Regular
- Joined
- Sep 28, 2018
- Messages
- 72
- Office Version
- 365
- Platform
- Windows
Hi
I have some shapes (arrows = called drop1, drop2.... etc) on my spreadsheet, which i want to appear/disappear depending on the value of cell C4. This below works ok but to me seems long winded, especially considering i need to add another hundred arrows or so, and then duplicate the whole thing for cell C7.
The only thing that changes is this end number for the shape. I have tried all manner of ways to change this but all fail. There must be a way! If any clever person can help I will be most grateful.
I have some shapes (arrows = called drop1, drop2.... etc) on my spreadsheet, which i want to appear/disappear depending on the value of cell C4. This below works ok but to me seems long winded, especially considering i need to add another hundred arrows or so, and then duplicate the whole thing for cell C7.
The only thing that changes is this end number for the shape. I have tried all manner of ways to change this but all fail. There must be a way! If any clever person can help I will be most grateful.
Code:
Private Sub Worksheet_Calculate()If Range("C4") = 3 Then
Me.Shapes("drop1").Visible = True
Me.Shapes("drop2").Visible = True
Me.Shapes("drop3").Visible = True
Me.Shapes("drop4").Visible = True
Me.Shapes("drop5").Visible = True
Me.Shapes("drop6").Visible = True
Me.Shapes("drop7").Visible = True
Me.Shapes("drop8").Visible = True
Else
Me.Shapes("drop1").Visible = False
Me.Shapes("drop2").Visible = False
Me.Shapes("drop3").Visible = False
Me.Shapes("drop4").Visible = False
Me.Shapes("drop5").Visible = False
Me.Shapes("drop6").Visible = False
Me.Shapes("drop7").Visible = False
Me.Shapes("drop8").Visible = False
End If
End Sub