Results 1 to 9 of 9
  1. #1
    Star Lounger
    Join Date
    Jun 2005
    Location
    Singapore
    Posts
    89
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Create Forms (Office XP)

    Hi all,


    Is there a difference between the form from the Dialog when I insert a new sheet and the form from the VBE. ?
    I have created a form with a command button using the MS Excel dialog and write the code under the click. However, I can't change the colour of the form. Is it non changable?

    Is it possible to have multiple subs or functions in one command button? How can I put them together ( ie code the under form or insert a new module ) with other code in a form with a command button so that this will also perform functions, such as import text , find specific "text" and insert 1 in it's column E, delete columns, delete rows where column E contains zero.... all in one click..
    Is it possible to do it this way or I must have the equal numbers of command buttons for each function to be perform. Why isn't the form show even though you have create a form, how do you made it visible upon starting the file.

    Pls advise how you would design a form like this.. just want to gather some ideas. btw, I notice there is a MVP and WMVP under some of your name, may I know what WMVP stand for.

    Pls pardon my novice-ness

    Thanks, kun

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Create Forms (Office XP)

    1) You shouldn't use the MS Excel 5.0 Dialog Sheet that is available when you right-click a worksheet tab and click Insert... It is only there for compatibility purposes.
    If you want to create a form, activate the Visual Basic Editor and select Insert | UserForm.

    2) One command button can execute several macros in turn:

    Sub CommandButton1_Click()
    Call Macro1
    Call Macro2
    Call MacroC
    End Sub

    3) MVP (Most Valuable Professional) is a title bestowed by Microsoft on people as a recognition of their expertise and helpfulness to others in public forums, especially in the Microsoft Newsgroups. Some of the participants here in Woody's Lounge are MVPs, for example <!profile=Pieterse>Pieterse<!/profile>. See Microsoft Most Valuable Professional for more infomation.

    WMVP (Woody's Most Valuable Pro) is a title awarded in Woody's Lounge to people who are knowledgeable and helpful here. See <!help=16>Help 16<!/help> for an overview of the status and titles we use, and see the VIP List for a listing of the WMVPs and Moderators.

  3. #3
    Star Lounger
    Join Date
    Jun 2005
    Location
    Singapore
    Posts
    89
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Create Forms (Office XP)

    Hans,

    Using the userform in VBE does not show when I start the file, how do I make it visible upon opening.

    thanks, kun

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Create Forms (Office XP)

    Double click ThisWorkbook in the treeview on the left hand side of the Visual Basic Editor.

    Enter the following code:

    Private Sub Workbook_Open()
    UserForm1.Show
    End Sub

    where UserForm1 is the name of the userform you created. Workbook_Open will be executed automatically each time the workbook is opened.

  5. #5
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Weert, Limburg, Netherlands
    Posts
    4,812
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Create Forms (Office XP)

    Hi Kun,

    You might be better off using a toolbar with a couple of buttons on it than using a userform.

    Have a look at my pages about distributing a macro for lots of information about things like this.
    Jan Karel Pieterse
    Microsoft Excel MVP, WMVP
    www.jkp-ads.com
    Professional Office Developers Association

  6. #6
    Star Lounger
    Join Date
    Jun 2005
    Location
    Singapore
    Posts
    89
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Create Forms (Office XP)

    Hi Pieterse,

    Your page is very informative, I would like to create a toggle toolbar with a couple of buttons for a small program. Currently , all my code are in personal marco and I would like to move them out so that others can use it. as well.
    Can I incorporate some of the marco into 1 button?

    Thanks, kun

  7. #7
    Star Lounger
    Join Date
    Jun 2005
    Location
    Singapore
    Posts
    89
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Create Forms (Office XP)

    Hans,

    Is there a way to add a minimise button on the userform?

    thanks, kun

  8. #8
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Create Forms (Office XP)

    No, userforms do not have a mximize or minimize button, only a close button.

  9. #9
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Create Forms (Office XP)

    It depends on what you want to do. You can create a macro that calls several other macros, as mentioned higher up in this thread (<post#=495662>post 495662</post#>). You can then assign that macro to a custom toolbar button.

Posting Permissions

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