+ Reply to Thread
Results 1 to 8 of 8

userform being pushed off the screen

  1. #1
    Forum Contributor
    Join Date
    03-21-2004
    Location
    Norwich, CT USA
    MS-Off Ver
    Excel 2010
    Posts
    163

    userform being pushed off the screen

    I have a userform that updates columns of data, one column at a time base on heading selection on the form. After the update occurs the userform is positioned to the right of the column that it provided input to, for review. This can be one of many columns, currently 33 columns.

    The problem is that when the userform is positioned to the right of the last column and the excel window is maximized, the userform is off the screen.

    Is it possible to make the worksheet scroll enough to the right so that the userform will be visible when the userform is positioned to the right of the last column and the excel window is maximized?


    The positioning is done mainly in the last 10 lines

    Please Login or Register  to view this content.
    I'm attaching the workbook also. the button that activates the code is on row 33 labeled "Update topic"
    Attached Files Attached Files

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: userform being pushed off the screen

    What input should we make on the userform to illustrate the problem?

    PS Have you considered using a listbox for the attendees? It could be set up so each attendee has a checkbox.
    If posting code please use code tags, see here.

  3. #3
    Forum Contributor
    Join Date
    03-21-2004
    Location
    Norwich, CT USA
    MS-Off Ver
    Excel 2010
    Posts
    163

    Re: userform being pushed off the screen

    Norie,
    f you select "orientation" that will show a good alignment between the user form and the cell. then run again and choose "Fall Protection"

    I looked at listboxes a little but I did not see where it would be any better. Can you point me to an example of what you are talking about?

    thanks for helping!
    Robert

  4. #4
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: userform being pushed off the screen

    Robert

    I'll give that a try. In the meantime you might want to look at using Application.Goto to scroll the worksheet to where you want it.

    The main advantage of a listbox would be that you would only have 1 control to deal with instead of a separate checkbox for each attendee.

    So instead of looping through all controls as you do in the cbt_Enter_Date you would just lop through the listbox.

    Here's how you could populate the listbox and set it up to display checkboxes, this would go in the form's Initialize.
    Please Login or Register  to view this content.
    To loop through it and check which attendess have been selected/checked.
    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    03-21-2004
    Location
    Norwich, CT USA
    MS-Off Ver
    Excel 2010
    Posts
    163

    Re: userform being pushed off the screen

    Thanks! the listbox with fmListStyleOption set is perfect for my application. Great advice Norie!


    Quote Originally Posted by Norie View Post
    Robert

    I'll give that a try. In the meantime you might want to look at using Application.Goto to scroll the worksheet to where you want it.

    The main advantage of a listbox would be that you would only have 1 control to deal with instead of a separate checkbox for each attendee.

    So instead of looping through all controls as you do in the cbt_Enter_Date you would just lop through the listbox.

    Here's how you could populate the listbox and set it up to display checkboxes, this would go in the form's Initialize.
    Please Login or Register  to view this content.
    To loop through it and check which attendess have been selected/checked.
    Please Login or Register  to view this content.

  6. #6
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: userform being pushed off the screen

    I found this Form Positioner .

    After downloading the file and importing (dragging) the module modPositioner to your file I tried this.
    Please Login or Register  to view this content.

  7. #7
    Forum Contributor
    Join Date
    03-21-2004
    Location
    Norwich, CT USA
    MS-Off Ver
    Excel 2010
    Posts
    163

    Thumbs up Re: userform being pushed off the screen

    Norie, I was able to use application.goto scroll the worksheet to keep the form on the page. the code follows. I added a bit to prompt the user if they forget to select any attendees which I'm having trouble with. But I will post that in a separate topic.
    Thanks again for your help!
    Robert

    Please Login or Register  to view this content.

  8. #8
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: userform being pushed off the screen

    Robert

    What's the problem with no attendees selected?

    As far as I can see the code should handle that.

+ 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