Sub RemoveEmptyTextBoxes()
Dim shp As Shape
' Loop through all shapes in the active sheet
For Each shp In ActiveSheet.Shapes
' Check if the shape is a TextBox and if its text is empty
If shp.Type = msoTextBox And shp.TextFrame.Characters.Text = "" Then
' Delete the TextBox
shp.Delete
End If
Next shp
End Sub
so instead of AND use two IF functions?
how would it look like the whole code?
If shp.Type = msoTextBox Then
If shp.TextFrame.Characters.Text = "" Then
' Delete the TextBox:
shp.Delete
End If
End If