- I have some buttons set-up to insert pre-set diagrams from sheet “FISH PARTS” onto sheet “THE JUMPER FISHBONE”
- However, before inserting a new diagram onto sheet “THE JUMPER FISHBONE” I need to make sure the default diagram components are all gone.
- There are seven components all with structure Like “BONE_*”
- If one or more of these components are present I want to display a message to confirm the user wishes to delete the default diagram and insert new chart (or abort is they do not wish to delete the default)
- some explaination of structure below
- spreadsheet also attached
Sub CHART_TYPE_FISHBONE_6()
‘Check for: "BONE_*" worksheet “THE JUMPER FISHBONE”
‘If one or more of these objects are present: MsgBox "Do You Really Want to Delete ‘Default Fishbone Diagram?"
‘User Selects Yes or No
‘If no, abort and do nothing
‘If yes, delete all "BONE_*" and (run code below)
On Error Resume Next
ActiveSheet.Shapes("FISHBONE_6").Select
If (Err.Number <> 0) Then
On Error GoTo 0
Sheets("FISH PARTS").Select
ActiveSheet.Shapes("FISHBONE_6").Select
Selection.Copy
Sheets("THE JUMPER FISHBONE").Select
Range("C3").Select
ActiveSheet.Paste
Else
On Error GoTo 0
MsgBox "6 Bone Fishbone already exists"
End If
End Sub
Bookmarks