+ Reply to Thread
Results 1 to 5 of 5

How to open a userform with a button ?

  1. #1
    Forum Contributor
    Join Date
    03-30-2010
    Location
    Washington DC
    MS-Off Ver
    Excel 2007
    Posts
    458

    How to open a userform with a button ?

    A very quick question. I have a userform called "Automation". I have a button on a worksheet called FASB 157 Automation in a workbook called called 157_Disclosure_Automation.xlsm. I would like to apply VBA code to the button so that it opens the userfrom.

    I tried this and it does not work.

    Please Login or Register  to view this content.
    Any suggestioons ? Thanks
    Last edited by AnthonyWB; 09-10-2010 at 10:57 AM.

  2. #2
    Forum Expert Domski's Avatar
    Join Date
    12-14-2009
    Location
    A galaxy far, far away
    MS-Off Ver
    Darth Office 2010
    Posts
    3,950

    Re: How to open a userform with a button ?

    Please Login or Register  to view this content.

    You should be able to just pop that code in a module and attach the macro to a button from your Forms toolbar.

    Dom
    "May the fleas of a thousand camels infest the crotch of the person who screws up your day and may their arms be too short to scratch..."

    Use code tags when posting your VBA code: [code] Your code here [/code]

    Remember, saying thanks only takes a second or two. Click the little star to give some Rep if you think an answer deserves it.

  3. #3
    Forum Contributor
    Join Date
    04-21-2007
    Location
    Lima, Peru
    MS-Off Ver
    2000, 2007, 2010
    Posts
    674

    Re: How to open a userform with a button ?

    Hi

    Enter design mode, double click on the button and you will be taken to the VBE with the cursor in the relevant code, e.g.
    Please Login or Register  to view this content.
    . At the cursor enter your code
    Please Login or Register  to view this content.
    and you are good to go.

    Regards

    Jeff

  4. #4
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    22,015

    Re: How to open a userform with a button ?

    Please Login or Register  to view this content.
    Everyone who confuses correlation and causation ends up dead.

  5. #5
    Forum Contributor
    Join Date
    03-30-2010
    Location
    Washington DC
    MS-Off Ver
    Excel 2007
    Posts
    458

    Re: How to open a userform with a button ?

    Domski and solnajeff, thanks it works perfectly.

+ 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