+ Reply to Thread
Results 1 to 17 of 17

Adding a command button for :REVIEW

  1. #1
    Registered User
    Join Date
    06-27-2017
    Location
    Georgia, USA
    MS-Off Ver
    Windows Office 2016
    Posts
    9

    Adding a command button for :REVIEW

    I currently have a command button on my userform for the user to "SUBMIT" the data that they entered. This command button pushes the data entered to other worksheets where the data is pertinent. I want to create a "REVIEW" button for the person that is approving the data to use. When clicked, I would like the macro to take them to the data sheets that the "SUBMIT" button sent the data to so they can verify and approve the data accordingly. Here is the catch, the review button should only work if the Windows username matches those specified in the code. Similar to the way my code is written to automatically unprotect all of the sheets based on username. Any help would be greatly appreciated!
    Last edited by Robert Conklin; 06-28-2017 at 08:08 AM. Reason: Add Attachment

  2. #2
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MSO Home and Business 2024
    Posts
    7,297

    Re: Adding a command button for :REVIEW

    Set the CommandButton.Enabled to False in Design Mode.

    Use next code when opening Userform to set property to True when Username is correct

    Please Login or Register  to view this content.
    Avoid using Select, Selection and Activate in your code. Use With ... End With instead.
    You can show your appreciation for those that have helped you by clicking the * at the bottom left of any of their posts.

  3. #3
    Registered User
    Join Date
    06-27-2017
    Location
    Georgia, USA
    MS-Off Ver
    Windows Office 2016
    Posts
    9

    Re: Adding a command button for :REVIEW

    Thanks Bakerman2!!

  4. #4
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MSO Home and Business 2024
    Posts
    7,297

    Re: Adding a command button for :REVIEW

    You're welcome and thanks for rep+.

  5. #5
    Registered User
    Join Date
    06-27-2017
    Location
    Georgia, USA
    MS-Off Ver
    Windows Office 2016
    Posts
    9

    Re: Adding a command button for :REVIEW

    i tried to set up the code above, but I keep getting a Runtime error 424: Object Required message. I do not think I have my code set up properly. Can you send an example of how the entire code should look like? When the command button is click I need it to take the user to the ADD_EXTEND worksheet.

  6. #6
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MSO Home and Business 2024
    Posts
    7,297

    Re: Adding a command button for :REVIEW

    Please repost your example file, but this time without the password protection.

  7. #7
    Registered User
    Join Date
    06-27-2017
    Location
    Georgia, USA
    MS-Off Ver
    Windows Office 2016
    Posts
    9

    Re: Adding a command button for :REVIEW

    i have uploaded another copy of the spreadsheet without any code, but i cannot seem to be able to disable the password prompt
    when you open the file.

  8. #8
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MSO Home and Business 2024
    Posts
    7,297

    Re: Adding a command button for :REVIEW

    Without the password I can't do much for you. PM me the password if you don't wanna go public with it.
    On the otherhand Object required often means that your commandbutton isn't called CommandButton1. Change that in the code to the proper name of the button.

  9. #9
    Registered User
    Join Date
    06-27-2017
    Location
    Georgia, USA
    MS-Off Ver
    Windows Office 2016
    Posts
    9

    Re: Adding a command button for :REVIEW

    I apologize for the late response. The password is SPAR. I cannot figure out how to get the workbook to stop asking me for a password when I try to open it.

  10. #10
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MSO Home and Business 2024
    Posts
    7,297

    Re: Adding a command button for :REVIEW

    Added the butoon and the code.
    The code to protect workbook is situated in the ThisWorkBook section.

  11. #11
    Registered User
    Join Date
    06-27-2017
    Location
    Georgia, USA
    MS-Off Ver
    Windows Office 2016
    Posts
    9

    Re: Adding a command button for :REVIEW

    I think you sent the wrong file. There is only the ADD-EXTEND button on the screen.

  12. #12
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MSO Home and Business 2024
    Posts
    7,297

    Re: Adding a command button for :REVIEW

    The button is on the userform as requested.

  13. #13
    Registered User
    Join Date
    06-27-2017
    Location
    Georgia, USA
    MS-Off Ver
    Windows Office 2016
    Posts
    9

    Re: Adding a command button for :REVIEW

    Gotcha, you are a genius!! This is perfect!! One thing that just hit me, if a user that is not on the authorized list
    clicks the Review button, what do I add to the code to display a message that states "You are not Authorized". Below is
    the code you used.

    Private Sub UserForm_Initialize()
    Review.Enabled = (Environ("username") = "Rudi")
    End Sub

  14. #14
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MSO Home and Business 2024
    Posts
    7,297

    Re: Adding a command button for :REVIEW

    Try this one then.
    Last edited by bakerman2; 06-30-2017 at 08:38 PM.

  15. #15
    Registered User
    Join Date
    06-27-2017
    Location
    Georgia, USA
    MS-Off Ver
    Windows Office 2016
    Posts
    9

    Re: Adding a command button for :REVIEW

    That works great. Thank you very much for your help, and patience!!

  16. #16
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MSO Home and Business 2024
    Posts
    7,297

    Re: Adding a command button for :REVIEW

    You're welcome.

  17. #17
    Registered User
    Join Date
    02-06-2020
    Location
    mexico
    MS-Off Ver
    windows 10
    Posts
    5

    Re: Adding a command button for :REVIEW

    Quote Originally Posted by bakerman2 View Post
    You're welcome.
    Bakerman, Sorry to steal this topic. I am saw your code and it is indeed very usefull. I am trying to convert to my own needs. Buit i am stuck in a small problem.

    For example:
    Please Login or Register  to view this content.
    Is there a property fields somewhere cause for example [BUoM].Value, i cannot see my new selections when i run the macro.

+ 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. Adding a vlookup into VBA command button ?
    By radgrad in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-17-2014, 11:55 AM
  2. Adding code to the end of a command button.
    By jharaldson in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-07-2012, 03:34 PM
  3. [SOLVED] Adding a command button to the menu
    By stojko89 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-13-2012, 01:29 AM
  4. Need help with adding Command button
    By lynhall in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-20-2008, 03:03 PM
  5. Adding a new sheet with command button
    By crapmind in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 08-13-2007, 04:05 AM
  6. Adding a textbox via command button
    By NewExcelUser in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 11-22-2006, 12:49 PM
  7. Adding A Date Command Button
    By hazey in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-12-2005, 05:55 PM
  8. adding a command button to an excel cell?
    By betelguese in forum Excel General
    Replies: 1
    Last Post: 03-22-2005, 12:06 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