To guess a macro name is almost the same as guessing a password.
Yep. And, the longer and more descriptive you make it, the less chance there is that it can be guessed or typed by accident.
Private Sub sCreate_Invoices_From_Orders_Sheet()
I know that's a bit over the top ... don't think I actually do that ... but you get the drift. No way can you guess it ... or type it accidentally.
If it's called from a main subroutine, a button or a shape, you could pass it a parameter ... useful or not.
Private Sub sCreate_Invoices_From_Orders_Sheet(ByRef OrdersSheet As Worksheet)
I believe that you can actually call a subroutine AND pass it a parameter in the Macro Dialogue Box ... but I'd be impressed if anyone did.
Nothing is bulletproof ... but you can make it pretty secure. Just don't call your subroutines A, B, C, etc., no matter how convenient.
Regards, TMS
If you are satisfied with the solution(s) provided, please mark your thread as Solved.
New quick method:
Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.
Or you can use this way:
How to mark a thread Solved
Go to the first post
Click edit
Click Go Advanced
Just below the word Title you will see a dropdown with the word No prefix.
Change to Solved
Click Save
You may also want to consider thanking those people who helped you by clicking on the little star at the bottom left of their reply to your question.
Bookmarks