Advertisement
Guest User

Untitled

a guest
Jun 15th, 2019
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. Sub CreateMenu()
  2. ' Delete the CommandBar if it exists already
  3. On Error Resume Next
  4. Application.CommandBars("Worksheet Menu Bar").Controls("My Tool").Delete
  5.  
  6. Set cControl = Application.CommandBars("Worksheet Menu Bar").Controls.Add
  7. With cControl
  8. .Caption = "My Tool"
  9. .Style = msoButtonCaption
  10. End With
  11.  
  12.  
  13. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement