Minimizing Forms

  • Hi again


    I'm still playing with a form for users. So far I didn have the form making the workbooks invisible to the user once it is opened, however there is not a minimize button on the form, and it isn't on the tool bar.
    Is there any way I can stop the user from uising the workbooks, but still let the form put values into the workbooks, and how can I make the screen not get messy with lots of information.
    Currently, the user opens a workbook that runs the form. The form then opens another workbook (as defined by the user). Then the form puts data into the new sheet that they have opened. Upon closure of the form, all the workbooks close (unfortunately all other workbooks close too!).
    This is a bit of a messy question I know, but any help advice would be great!


    Thanks

  • Re: Minimizing Forms


    Dancindan,


    Quote

    I'm still playing with a form for users. So far I didn have the form making the workbooks invisible to the user once it is opened, however there is not a minimize button on the form, and it isn't on the tool bar.


    There is a method to put the minimize / maximize buttons on a userform. However, it isn't pretty and takes some pretty serious bit of coding on your part.


    Quote

    Is there any way I can stop the user from uising the workbooks, but still let the form put values into the workbooks


    Check the form show properties. If the form is MODAL the user can't interact with the workbook beneath it. If it's MODELESS then the user can. Just change the property. This is a feature found in XL 2000 and above.


    Quote

    , but still let the form put values into the workbooks


    "

    Code
    Sub CodeFormToWorksheet
         Range(""A1"") = Userform1.TextBox1
    .
    .
    '    If this is a routine in the code page for the userform then you can use
         Range(""A1"") = Me.TextBox1
    End Sub

    "


    Quote

    how can I make the screen not get messy with lots of information


    Using a multipage form will allow you to logically group information and reduce screen clutter


    Quote

    Currently, the user opens a workbook that runs the form. The form then opens another workbook (as defined by the user). Then the form puts data into the new sheet that they have opened. Upon closure of the form, all the workbooks close (unfortunately all other workbooks close too!).


    To close a particular workbook use the following code.
    "

    "

  • Re: Minimizing Forms


    To create a minimise/maximise button place a commandbutton at the top of the UserForm, name it eg cbxmin then use this code

    Code
    Private Sub cbxmin_Click()
    If Me.cbxmin.Caption = "Minimise" Then
    Me.Height = 50
    Me.cbxmin.Caption = "Maximise"
    ElseIf Me.cbxmin.Caption = "Maximise" Then
    Me.Height = 175
    Me.cbxmin.Caption = "Minimise"
    End If
    End Sub


    adjust the height to suit your userform

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!