I have a label/shape that I want to ultimately cover over cells, D16:E19
What I want to happen is;
Click on the label/shape and for it to Close
To then be able to input data into cells D16:E19, and as long as any cell in D16:E19 is greater than zero, the label will remain Closed
But then when/if ALL cells in D16:E19 are zero the label will Open back up
Attached is code from a Recorded Macro that I added to the labels ‘Click ()’ event sub.
Clearly this is not going to allow me to do what I want, but it may show what I am trying to do
Or would it be better to have a permanent Named Button/Toggle switch that will open or close the Label as and when I choose?
What I want to happen is;
Click on the label/shape and for it to Close
To then be able to input data into cells D16:E19, and as long as any cell in D16:E19 is greater than zero, the label will remain Closed
But then when/if ALL cells in D16:E19 are zero the label will Open back up
Attached is code from a Recorded Macro that I added to the labels ‘Click ()’ event sub.
Clearly this is not going to allow me to do what I want, but it may show what I am trying to do
Or would it be better to have a permanent Named Button/Toggle switch that will open or close the Label as and when I choose?
VBA Code:
Private Sub Enter_Values_Label_1_Click()
' Code used is from the Recorded Macro
' Used Alt>F10 to open "Selection and Visibility" > "Shapes on Sheet",
' Then clicked option button for ("Enter_Values_Label_1"), to CLOSE it (msoFalse).
' Then made some random entries and then deleted them.
' Then went back and returned ("Enter_Values_Label_1"), to Open it (msoTrue)
ActiveSheet.Shapes.Range(Array("Enter_Values_Label_1")).Visible = msoFalse
Range("D16").Select
ActiveCell.FormulaR1C1 = "1"
Range("D18").Select
ActiveCell.FormulaR1C1 = "1"
Range("D17").Select
ActiveCell.FormulaR1C1 = "2"
Range("D16:D18").Select
Selection.ClearContents
ActiveSheet.Shapes.Range(Array("Enter_Values_Label_1")).Visible = msoTrue
End Sub