+ Reply to Thread
Results 1 to 5 of 5

Make buttons active or inactive

  1. #1
    Registered User
    Join Date
    10-06-2011
    Location
    rsa
    MS-Off Ver
    Excel 2007
    Posts
    8

    Make buttons active or inactive

    Hi,

    I want to make a button on my userform to appear active when a certain cell has a certain value and appear inactive if not.

    What code can I use?

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

    Re: Make buttons active or inactive

    Please Login or Register  to view this content.



  3. #3
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Make buttons active or inactive

    Hi snb,

    You quote:"Avoid using VBA-code you do not understand"

    I do not understand exactly what ypur code commandbutton1.enabled=sheets(1).cells(1,5)=12 means.

    Please could you explain it to me


    Thank you

  4. #4
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Make buttons active or inactive

    Hi snb,

    Forget about it. I figured it out, thank you! That is a very nice shortcut way of coding instead of referencing specific individual cell addresses by using range, quotes, brackets, etc.

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

    Re: Make buttons active or inactive

    @Winon

    Much better you figured it out yourself !

+ 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