+ Reply to Thread
Results 1 to 13 of 13

Keep excel built in user form on top of sheet when opened

  1. #1
    Forum Contributor
    Join Date
    12-20-2011
    Location
    lancashire,England
    MS-Off Ver
    Excel 2013
    Posts
    187

    Keep excel built in user form on top of sheet when opened

    This should be easy, but i cant seem to find the answer !! The built in excel user form function is fine for what i want to do, as i just need to see the whole fields available, without VBA etc. question is. How can i keep the form on top when file openeduser form.jpg i have the user form button on my quick access toolbar, but there are lots of people who enter data into it, and i cant account for everone. Any help is much appreciated............
    Last edited by interested; 11-28-2012 at 08:12 AM.

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2502
    Posts
    26,852

    Re: Keep excel built in user form on top of sheet when opened

    Can you clarify the problem? The automatic form is modal, so it is always on top and you can't activate any part of the worksheet until you close the form.

    Do you mean that you want the form to open automatically when the workbook is opened?
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Forum Contributor
    Join Date
    12-20-2011
    Location
    lancashire,England
    MS-Off Ver
    Excel 2013
    Posts
    187

    Re: Keep excel built in user form on top of sheet when opened

    Yes. I would like the built in form visable when you open a work book by default.

  4. #4
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2502
    Posts
    26,852

    Re: Keep excel built in user form on top of sheet when opened

    You need a macro to do this.

    Are you familiar with VBA macros? In the module called ThisWorkbook, add this code:
    Please Login or Register  to view this content.
    Users will have to allow macros to run.

  5. #5
    Forum Contributor
    Join Date
    12-20-2011
    Location
    lancashire,England
    MS-Off Ver
    Excel 2013
    Posts
    187

    Re: Keep excel built in user form on top of sheet when opened

    I tried Alt+F11, but its just blank, i cant see a module called "this work book"...see attached vba.jpg or do i need to do something else....Thanks for the reply so far

  6. #6
    Forum Contributor
    Join Date
    12-20-2011
    Location
    lancashire,England
    MS-Off Ver
    Excel 2013
    Posts
    187

    Re: Keep excel built in user form on top of sheet when opened

    ive stripped the data out, as there where 9000 lines to the attached work book. could you look at the attached for me?
    i'm sorry i dont understand the following


    ' in this location, select the data to be included on the form, such as
    Sheet1.Range("A1:E20").Select

    Sheet1.ShowDataForm
    End Sub

    do i have to re-name sheet1 , the tab name i have??
    i am asking as i may use this on other sheets we have.

    thanks again
    Attached Files Attached Files

  7. #7
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2502
    Posts
    26,852

    Re: Keep excel built in user form on top of sheet when opened

    I don't know why you can't expand the module for that workbook. It should have a plus sign like the others.

    See attached and let me know if that works for you. [interested=open data form on workbook open=User form example.xls]

  8. #8
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2502
    Posts
    26,852

    Re: Keep excel built in user form on top of sheet when opened

    Also, you don't have to rename worksheets to use this for other purposes, you just have to modify the code. In the code I provided, the expression Worksheets("Log") refers to the name on the tab that the user sees. My original example above refers to the name shown in the code but not visible to a user.

  9. #9
    Forum Contributor
    Join Date
    12-20-2011
    Location
    lancashire,England
    MS-Off Ver
    Excel 2013
    Posts
    187

    Re: Keep excel built in user form on top of sheet when opened

    yes, your example worked for me, and i understand why the module is not visable. Its a "shared" workbook.In the example i uploaded i just copied the first 3 lines. I took another copy,un shared it and the module was there. Is it posible to have the code on a shared book by some work round??

  10. #10
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Keep excel built in user form on top of sheet when opened

    you can't edit code in a shared workbook but you can unshare it, add the code and then share it again. as long as the code doesn't violate any of the restrictions of shared workbooks it should be fine
    Josie

    if at first you don't succeed try doing it the way your wife told you to

  11. #11
    Forum Contributor
    Join Date
    12-20-2011
    Location
    lancashire,England
    MS-Off Ver
    Excel 2013
    Posts
    187

    Re: Keep excel built in user form on top of sheet when opened

    Thanks for your input, but it does not save the code on a shared book when i tried. Maybe i will just have to have it un shared as the code is fine.

  12. #12
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Keep excel built in user form on top of sheet when opened

    you have to save it unshared with the code then share and save it

  13. #13
    Forum Contributor
    Join Date
    12-20-2011
    Location
    lancashire,England
    MS-Off Ver
    Excel 2013
    Posts
    187

    Re: Keep excel built in user form on top of sheet when opened

    Ah yes. Thankyou all for your help. will marked as solved.

+ 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