+ Reply to Thread
Results 1 to 7 of 7

Disable or Hide Command Button for certain users

  1. #1
    Registered User
    Join Date
    08-15-2014
    Location
    India
    MS-Off Ver
    2007
    Posts
    57

    Exclamation Disable or Hide Command Button for certain users

    Hi,

    Is there a way to hide Command Button for certain user and enable for certain.


    I dont know if thats Possible and tried below code but didnt go anywhere:

    Please Login or Register  to view this content.

    I am getting error at the module part.

    If hiding the Commad Button is not possible, is there a way to disable it and also to change its color (red preferred) so that user know its inactive.

    Thanks in Advance.

    Reg,
    CVishu

  2. #2
    Valued Forum Contributor xlbiznes's Avatar
    Join Date
    02-22-2013
    Location
    Bahrain
    MS-Off Ver
    Excel 2007
    Posts
    1,223

    Re: Disable or Hide Command Button for certain users

    In which sheet is your command button located ?

    this will hide the button named commandbutton1 in sheet1.

    Please Login or Register  to view this content.
    Happy Computing ,

    Xlbiznes.

    To show your appreciation please click *

  3. #3
    Registered User
    Join Date
    08-15-2014
    Location
    India
    MS-Off Ver
    2007
    Posts
    57

    Re: Disable or Hide Command Button for certain users

    Hi,

    Thanks for the reply, however I got the button hidden using the below code:

    Please Login or Register  to view this content.
    Thanks.

    Reg,
    CVishu

  4. #4
    Registered User
    Join Date
    08-15-2014
    Location
    India
    MS-Off Ver
    2007
    Posts
    57

    Re: Disable or Hide Command Button for certain users

    Hi,

    The above Code works well and even the below code works well too when activated using a command button

    Please Login or Register  to view this content.
    A15 contain the name of buttons i wish to hide ie Home_Button,Print_Button,Close_Button etc


    However the same code is not working when I am activating it through a user from

    Hope to have expert advice on above.

    Reg,
    CVishu

  5. #5
    Valued Forum Contributor xlbiznes's Avatar
    Join Date
    02-22-2013
    Location
    Bahrain
    MS-Off Ver
    Excel 2007
    Posts
    1,223

    Re: Disable or Hide Command Button for certain users

    Hi,

    check this workbook, i have tried to simulate what you want and it works fine.
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    08-15-2014
    Location
    India
    MS-Off Ver
    2007
    Posts
    57

    Re: Disable or Hide Command Button for certain users

    Hi,

    Thanks for the reply, however it wont solve my problem. I believe I need to elaborate a little more on what I wish to achieve with this. So here's my Goal:

    When the sheet will open a Login form will appear which will ask the user for User ID & Password. The Workbook contains a sheet named ("Users") which have the user name in A2, Password in B2 and Command button name which will get hidden in C2.

    Further now all the buttons will be in a Form named "welcome" instead of in a sheet (thought of this change later and dont have the sheet ready to attach here, but I hope you got the idea).

    Reg,
    CVishu

  7. #7
    Valued Forum Contributor xlbiznes's Avatar
    Join Date
    02-22-2013
    Location
    Bahrain
    MS-Off Ver
    Excel 2007
    Posts
    1,223

    Re: Disable or Hide Command Button for certain users

    a) A login form opens when the user opens the workbook.
    b) Validate the user id and password with the sheet "Users"
    c) if valid user ,close the login form and allow the user to interact with the workbook.
    d) If invalid user close form , close workbook.

    Is this what you wish to achieve ?

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Disable close workbook but still force users to close thru command button
    By rathig in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-18-2013, 07:29 AM
  2. [SOLVED] Disable command Button
    By Rick_Stanich in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-07-2012, 03:13 PM
  3. Disable command button
    By kuraitori in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-01-2009, 03:38 AM
  4. Disable Command Button
    By Raj in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-10-2006, 01:01 AM
  5. Disable command button
    By Mikeice in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-17-2005, 06:05 AM

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