Consulting

Results 1 to 4 of 4

Thread: Solved: VBA userform

  1. #1

    Solved: VBA userform

    Hi All,

    I have created on userform in VBA. I want it to be activated when i open the workbook.
    I mean whenever i open that workbook that form should appear.

    Please give me the solution and i will give appreciation..

    Thanks in advance

  2. #2
    Moderator VBAX Master georgiboy's Avatar
    Joined
    Mar 2008
    Location
    Kent, England
    Posts
    1,198
    Location
    In the ThisWorkbook window in the VBE paste this...

    [VBA]Private Sub Workbook_Open()

    UserForm1.Show

    End Sub[/VBA]

    Assuming your userform is called UserForm1.

    Hope this helps
    Click here for a guide on how to add code tags
    Click here for a guide on how to mark a thread as solved
    Click here for a guide on how to upload a file with your post

    Excel 365, Version 2403, Build 17425.20146

  3. #3
    It works.

    Thank you very much.

  4. #4
    Administrator
    VP-Knowledge Base
    VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    If you need to be able to work in the Spreadsheet with the form on the screen, then open it non-modal

    [vba] .
    UserForm1.Show False

    [/vba]
    MVP (Excel 2008-2010)

    Post a workbook with sample data and layout if you want a quicker solution.


    To help indent your macros try Smart Indent

    Please remember to mark threads 'Solved'

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •