goncalocoelho
New Member
- Joined
- Apr 15, 2020
- Messages
- 9
- Office Version
- 2016
- Platform
- Windows
Hi! I'm new to the forum and to VBA code, and I'm in need of some help.
I'm currently working on a form type of sheet in Excel and I have a macro that validates certain cells as Lists. This all works fine until I add a sub to delete shapes in the Sheet.
The sub that causes this problem is the following:
The sub works and delete all the shapes except the one named "Description" as it is intended, but it also makes all the drop down lists unusable.
Hopefully the pictures bellow will help understand my problem,
Hopefully some of you guys can help me understand why this isn't working.
I'm currently working on a form type of sheet in Excel and I have a macro that validates certain cells as Lists. This all works fine until I add a sub to delete shapes in the Sheet.
The sub that causes this problem is the following:
VBA Code:
Sub delete_shp2()
Dim shp2 As Shape
For Each shp2 In Sheets("Form").Shapes
If shp2.Name = "Description" Then
Else
shp2.Delete
End If
Next shp2
End Sub
The sub works and delete all the shapes except the one named "Description" as it is intended, but it also makes all the drop down lists unusable.
Hopefully the pictures bellow will help understand my problem,
Hopefully some of you guys can help me understand why this isn't working.
This is before i ran the Sub delete_shp2(), all the dropdowns lists are working fine | And then, when i run the macro, the little box that allows for the list selection disappear in all of the dropdown cells |