Is it possible to disable a Label1_Click that runs a macro by workbook name.
ThanksPlease Login or Register to view this content.
Is it possible to disable a Label1_Click that runs a macro by workbook name.
ThanksPlease Login or Register to view this content.
Last edited by zplugger; 01-07-2012 at 05:18 PM.
Hello Zplugger,
You can set the Labels's Enabled property to False.
Sincerely,
Leith Ross
Remember To Do the Following....
1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.2. Thank those who have helped you by clicking the Star below the post.3. Please mark your post [SOLVED] if it has been answered satisfactorily.
Old Scottish Proverb...
Luathaid gu deanamh maille! (Rushing causes delays!)
Please Login or Register to view this content.
I guess what I mean is if the workbook is book1 then the label click works,if its a different name it does not.
If ThisWorkbook.Name <> "book1.xlsm" Then
Label1_Click = False
End if
Put this in at the start of the Label1_Click routine
It sounds like you have a workbook and anticipate someone SaveAs ing the workbook with a different name.Please Login or Register to view this content.
And that you want Label1 in that new workbook to be disabled.
Perhaps you should also write a Workbook_Open routine that looks at the workbook's name and then changes the label to read something besides "Click here for good stuff"
(What if the user desisies to re-name, but not copy Book1.xls?)
Last edited by mikerickson; 01-07-2012 at 05:10 PM.
_
...How to Cross-post politely...
..Wrap code by selecting the code and clicking the # or read this. Thank you.
It sounds like you have a workbook and anticipate someone SaveAs ing the workbook with a different name.
And that you want Label1 in that new workbook to be disabled. This is correct because the label controls a invoice number and when
I change the workbook name I don't want the number on the invoice change. If it is change it will mess up my invoice numbers in the
main book.
O No I forgot to
Thank You guy's for your Help.
Z
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks