Results 1 to 5 of 5

Thread: Excel VBA Code For Minimizing UserForm

  1. #1
    Join Date
    Aug 2006
    Posts
    114

    Excel VBA Code For Minimizing UserForm

    I am writing an application that uses an Excel sheets to store data. Also in that application all the controls and inputs are to be run from a form. Now my problem is that I am not able to minimize my excel window. So all I need is some Excel VBA Code For Minimizing UserForm. If somebody knows the coding of that, please help me by providing that coding.
    |===================|
    |YAY if that made sense...|
    |===================|

  2. #2
    Join Date
    Jan 2008
    Posts
    1,521

    Re: Excel VBA Code For Minimizing UserForm

    According to me you should able to minimize your Excel by calling the WindowState as minimized. The Excel VBA Code For Minimizing UserForm is as follows :
    Code:
    Application.WindowState = xlMinimized
    Hope that this code will help you to minimize the UserForm.

  3. #3
    Join Date
    Mar 2008
    Posts
    672

    Re: Excel VBA Code For Minimizing UserForm

    You can also try the following code for minimizing the User form :
    Code:
    Sub Workbook_Open()
    Application.WindowState = xlMinimized
    frm_Main.Show
    End Sub

  4. #4
    Join Date
    Mar 2008
    Posts
    349

    Re: Excel VBA Code For Minimizing UserForm

    I would like to suggest you to use the following code :
    Code:
    ActiveWindow.WindowState = xlMinimized
    You will have to use this code at the beginning of your Open event. By doing this your active window will get minimized. Instead of using simply
    Code:
    Application.WindowState = xlMinimized
    Its better to use the above codes.

  5. #5
    Join Date
    Nov 2008
    Posts
    996

    Re: Excel VBA Code For Minimizing UserForm

    I am providing you the code that will be useful for adding a Minimize/Maximize Button to a UserForm. Here is the code for that :
    Dim dWidth As Double

    Code:
    Private Sub ToggleButton1_Click()
    
    	If ToggleButton1.Value = True Then
    
    		Me.Height = Me.Height * 0.30
    
        Else
    
           	Me.Height = dWidth
    
        End If
    
    End Sub
    
    Private Sub UserForm_Initialize()
    
        dWidth = Me.Height
    
    End Sub

Similar Threads

  1. crystal reports connection to excel vba userform
    By shankar.nstl in forum Software Development
    Replies: 1
    Last Post: 01-10-2011, 03:44 PM
  2. Replies: 2
    Last Post: 20-08-2010, 01:23 AM
  3. Minimizing to System Tray
    By Rising in forum Windows Vista Mail
    Replies: 2
    Last Post: 12-04-2010, 04:33 AM
  4. My games keep minimizing,what to do?
    By Agustíne in forum Video Games
    Replies: 5
    Last Post: 26-12-2009, 08:37 PM
  5. Use userform vba using Excel
    By AdityaR in forum Software Development
    Replies: 3
    Last Post: 25-06-2009, 12:19 AM

Tags for this Thread

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
  •  
Page generated in 1,713,507,499.59584 seconds with 17 queries