Hello all!
I have a macro that will add text boxes to a form template depending on the contents of cell D4:
If Range("D4").Value = "OGD" Then
ActiveSheet.OLEObjects.Add(ClassType:="Forms.TextBox.1", Link:=False, _
DisplayAsIcon:=False, Left:=3.75, Top:=270, Width:=333.75, Height:= _
62.25).Select
Selection.Name = "1"
It goes on to add another 6 text boxes to the template. If D4="FS" then it adds another 8 boxes. I want to be able to delete the boxes using a macro but can't work out how to tell it that if boxes 8 and 9 are there then delete them and if not then carry on. At the moment it gives me an error message if 8 and 9 aren't there.
I have other shapes in there so I can't do delete all shapes.
I hope that makes sense!
Thanks,
Dean
Bookmarks