@johnsonshiue,
I've never tried to do exactly what is being attempted here. However, the way I'm understanding the code, it does the following:
- Checks the sheet to see if it's the specified target name. If so, continue.
- Cycle through the balloons, checking the name of the view they are attached to. If the view name matches the target name, continue.
- Turn off the visibility of the layer that the balloons are on.
Since it works by turning off the layer, it will always shut off all the balloons unless the balloons for different views are placed on different layers. I think the code itself is actually functioning correctly, but it is the wrong logic for the intended result. I'm not sure if there is a way to do what is being asked for or not, but if a method does exist, turning the balloon layer off isn't it.
As written, this code can only result in the following two outcomes:
- The sheet and view names don't match the targets. Nothing happens.
- The sheet and view names match the targets. Turn off all the balloons.