+ Reply to Thread
Results 1 to 8 of 8

Creating a "complex" userform

  1. #1
    Forum Contributor
    Join Date
    03-30-2010
    Location
    Washington DC
    MS-Off Ver
    Excel 2007
    Posts
    458

    Creating a "complex" userform

    Hello everyone. So over the past few weeks I have created an automation which performs a specific accounting task. And this automation was "put" into an excel spreadsheet and the user executes the automation via buttons. Rather than use buttons on a spreadsheet I would like to use a userform. I have created the user form and here is how it looks: First there is a "Multipage" form with 5 tabs. The first tab is just a text box and I would like to put some instruction within the text box. On each of the other tabs there is a button and a text box. Now within each text box I want to put some instruction and help comments and each button needs to be tied into a piece of code: for example Module 4 Main. Any Suggestions? Thanks.
    Last edited by AnthonyWB; 08-13-2010 at 04:04 PM.

  2. #2
    Forum Expert davegugg's Avatar
    Join Date
    12-18-2008
    Location
    WI, US
    MS-Off Ver
    2010
    Posts
    1,884

    Re: Creating a "complex" userform

    What kind of suggestions do you need?
    I probably use labels instead of text boxes if the end users will not be putting data in. You can either assign text to labels or textboxes when viewing the form object and using the properties -> value property for a text box or properties -> caption property for a label. You can also assign then when the form loads using the form_initialize event.

    To run another sub from a button, just put the name of the sub on a line of code. You can also use the Call statement.
    Is your code running too slowly?
    Does your workbook or database have a bunch of duplicate pieces of data?
    Have a look at this article to learn the best ways to set up your projects.
    It will save both time and effort in the long run!


    Dave

  3. #3
    Forum Contributor
    Join Date
    03-30-2010
    Location
    Washington DC
    MS-Off Ver
    Excel 2007
    Posts
    458

    Re: Creating a "complex" userform

    I don't have experience with user forms so bare with me. The only input the user will enter is after he pushes a button.

    I have a button labeled Currency Rates [See code below] I want to assign this macro to this button. It is Module 1 Sub Main ().

    I will switch from text boxes to labels and put the instructions on the labels using the suggestion you mentioned.

    Please Login or Register  to view this content.

  4. #4
    Forum Expert davegugg's Avatar
    Join Date
    12-18-2008
    Location
    WI, US
    MS-Off Ver
    2010
    Posts
    1,884

    Re: Creating a "complex" userform

    It looks to me like you have it set up right. Then to call main you'd just put that in the button code like so:

    Please Login or Register  to view this content.
    As long as you don't have anything else named Main, that is all you need to do.

  5. #5
    Forum Contributor
    Join Date
    03-30-2010
    Location
    Washington DC
    MS-Off Ver
    Excel 2007
    Posts
    458

    Re: Creating a "complex" userform

    Thanks that does the work. Now it is an issue asthetics. By using a text box instead of a label the white background is more appealing to the eye. (The little stuff matters).

  6. #6
    Forum Contributor
    Join Date
    03-30-2010
    Location
    Washington DC
    MS-Off Ver
    Excel 2007
    Posts
    458

    Re: Creating a "complex" userform

    In retrospect I would rather place the instructions in a text box.

  7. #7
    Forum Expert davegugg's Avatar
    Join Date
    12-18-2008
    Location
    WI, US
    MS-Off Ver
    2010
    Posts
    1,884

    Re: Creating a "complex" userform

    That's fine, but be aware that there are many changes you can make to controls on a form by looking at the properties. For instance, whether using a textbox or a label, the BackColor property allows you to define the background color. You can change the style of the back color to transparent or opaque, you can change the font of the text, the text alignment, etc. You can also add a special effect, such as making the label/textbox raised, sunken, etched, etc.

  8. #8
    Forum Contributor
    Join Date
    03-30-2010
    Location
    Washington DC
    MS-Off Ver
    Excel 2007
    Posts
    458

    Re: Creating a "complex" userform

    yeah your right on htis, I'll stick with the labels. Thanks

+ 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