Advertisement
Guest User

Untitled

a guest
May 5th, 2016
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. Sub SameMacroForTwoDropDownBoxes()
  2.  
  3. 'The following line of code will tell you
  4. ' in a message box which of the two
  5. ' drop-down boxes initiated the macro
  6. MsgBox Application.Caller
  7.  
  8. End Sub
  9.  
  10. Sub SameMacroForTwoDropDownBoxes()
  11.  
  12. 'The following line of code will tell you
  13. ' in a message box which of the two
  14. ' drop-down boxes initiated the macro
  15. Select Case Application.Caller
  16. Case "Drop Down 1"
  17. MsgBox "The first drop-down box has been changed."
  18. Case "Drop Down 2"
  19. MsgBox "The second drop-down box has been changed."
  20. Case Else
  21. MsgBox "No idea where this was coming from..."
  22. End Select
  23.  
  24. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement