+ Reply to Thread
Results 1 to 7 of 7

Disable a LabelClick

  1. #1
    Forum Contributor
    Join Date
    03-05-2009
    Location
    usa
    MS-Off Ver
    Excel 2016 32Bit
    Posts
    1,173

    Disable a LabelClick

    Is it possible to disable a Label1_Click that runs a macro by workbook name.

    Please Login or Register  to view this content.
    Thanks
    Last edited by zplugger; 01-07-2012 at 05:18 PM.

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Disable a LabelClick

    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!)

  3. #3
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: Disable a LabelClick

    Please Login or Register  to view this content.



  4. #4
    Forum Contributor
    Join Date
    03-05-2009
    Location
    usa
    MS-Off Ver
    Excel 2016 32Bit
    Posts
    1,173

    Re: Disable a LabelClick

    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

  5. #5
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229

    Re: Disable a LabelClick

    Put this in at the start of the Label1_Click routine
    Please Login or Register  to view this content.
    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.

    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.

  6. #6
    Forum Contributor
    Join Date
    03-05-2009
    Location
    usa
    MS-Off Ver
    Excel 2016 32Bit
    Posts
    1,173

    Re: Disable a LabelClick

    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.

  7. #7
    Forum Contributor
    Join Date
    03-05-2009
    Location
    usa
    MS-Off Ver
    Excel 2016 32Bit
    Posts
    1,173

    Re: Disable a LabelClick

    O No I forgot to
    Thank You guy's for your Help.
    Z

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1