Hello all,
I have an issue and i searched all day a solution but i didn`t find it. I have a List box with multiple selection and it has 6 rows (it`s fixed). I want to do something if the list box has no selection (i want to hide a shape). I find on this forum a code but for me is not working because if i select one row i need to hit enter to unhide that shape. For unhide is the same, i unselect all rows and i need to hit enter to hide the shape. I nee a solution where i don`t need to hit enter.
This code is working only after i hit enter. This code is not mine is from Rick Rothstein
Thank you all !
I have an issue and i searched all day a solution but i didn`t find it. I have a List box with multiple selection and it has 6 rows (it`s fixed). I want to do something if the list box has no selection (i want to hide a shape). I find on this forum a code but for me is not working because if i select one row i need to hit enter to unhide that shape. For unhide is the same, i unselect all rows and i need to hit enter to hide the shape. I nee a solution where i don`t need to hit enter.
VBA Code:
Dim X As Long, FoundOne As Boolean
For X = 0 To ListBox1.ListCount
If ListBox1.Selected(X) Then
FoundOne = True
Exit For
End If
Next
If FoundOne Then
Worksheets("Sheet1").Shapes("Picture1").Visible = False
Else
Worksheets("Sheet1").Shapes("Picture1").Visible = True
End If
This code is working only after i hit enter. This code is not mine is from Rick Rothstein
Thank you all !