+ Reply to Thread
Results 1 to 14 of 14

I'm new to VBA UserForm that can reproduce formulas for totals.

  1. #1
    Registered User
    Join Date
    12-15-2017
    Location
    Fresno, CA
    MS-Off Ver
    2016
    Posts
    56

    I'm new to VBA UserForm that can reproduce formulas for totals.

    I'm looking to create a userform that can skip lines for my invoice and repeat the formula. This is what I'm doing so far.userformfill.PNG and I need something to continue this type of entry.
    Ignore column1 starting with 36 that was from a previous attempt with the userform. Please ask if this is confusing so I can try and clarify what I'm going for.

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,481

    Re: I'm new to VBA UserForm that can reproduce formulas for totals.

    Attaching a sample workbook enables others to work on your problem:

    To attach a sample workbook. Make sure there is just enough data to make it clear what is needed. Include BEFORE/AFTER sheets if needed to show the process you're trying to complete or automate. Remember to desensitize the data.

    Click on GO ADVANCED and click "manage attachments" to open the upload window.


    To add a file to a post

  3. #3
    Registered User
    Join Date
    12-15-2017
    Location
    Fresno, CA
    MS-Off Ver
    2016
    Posts
    56

    Re: I'm new to VBA UserForm that can reproduce formulas for totals.

    Here is the test file.
    Attached Files Attached Files

  4. #4
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,481

    Re: I'm new to VBA UserForm that can reproduce formulas for totals.

    You should have a sample with the userform

  5. #5
    Registered User
    Join Date
    12-15-2017
    Location
    Fresno, CA
    MS-Off Ver
    2016
    Posts
    56

    Re: I'm new to VBA UserForm that can reproduce formulas for totals.

    Thats the problem I'm having. I don't know how to create a userform to do this. I have always used the automated forms but they don't allow you to skip a line. I assume this would require VBA to do.
    Last edited by VShane; 12-18-2017 at 02:44 PM.

  6. #6
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,481

    Re: I'm new to VBA UserForm that can reproduce formulas for totals.

    Lots of info on how to create userforms, I have a simple example here.

    http://www.xlorate.com/userform-vba-page.html

    Once you have created a userform, then ask for help to code it.

  7. #7
    Registered User
    Join Date
    12-15-2017
    Location
    Fresno, CA
    MS-Off Ver
    2016
    Posts
    56

    Re: I'm new to VBA UserForm that can reproduce formulas for totals.

    Ok, I attached a userform with a description of how I want the form to work and would like to have it update the table on the worksheet.
    Attached Files Attached Files

  8. #8
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,481

    Re: I'm new to VBA UserForm that can reproduce formulas for totals.

    Is your file called test.xlsx.xlsm

    could you rename it and make sure it is just an .xlsm file, then attach it again.

  9. #9
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,481

    Re: I'm new to VBA UserForm that can reproduce formulas for totals.

    If your layout is going to be a table, you don't require a subtotal row for every item.

    Anyway, here is some code you can practice with, throw it in your Userform Module.

    Please Login or Register  to view this content.

  10. #10
    Registered User
    Join Date
    12-15-2017
    Location
    Fresno, CA
    MS-Off Ver
    2016
    Posts
    56

    Re: I'm new to VBA UserForm that can reproduce formulas for totals.

    OK here's the file without the double extension. I'll play with your code right now. Thanks!
    Attached Files Attached Files

  11. #11
    Registered User
    Join Date
    12-15-2017
    Location
    Fresno, CA
    MS-Off Ver
    2016
    Posts
    56

    Re: I'm new to VBA UserForm that can reproduce formulas for totals.

    Well the add sort of works... I need it to find the first blank line when adding it and add it there. Then I'd like the subtotals underneath but that's not as big of a deal. If the invoice# is already there then when I type "Enter" after filling in the invoice number it should find that and display the info. It does it when adding but not when looking for one. Maybe I need another button instead of typing "Enter"? I'm thinking of scrapping subtotals and letting the form do this calculation that I will be applying this to on another sheet.

  12. #12
    Registered User
    Join Date
    12-15-2017
    Location
    Fresno, CA
    MS-Off Ver
    2016
    Posts
    56

    Re: I'm new to VBA UserForm that can reproduce formulas for totals.

    Added your code to the userform and modified the worksheet. I'm not sure where to go from here.
    Attached Files Attached Files

  13. #13
    Registered User
    Join Date
    12-15-2017
    Location
    Fresno, CA
    MS-Off Ver
    2016
    Posts
    56

    Re: I'm new to VBA UserForm that can reproduce formulas for totals.

    Edited the sheet further after I realized the previous Column2 wasn't needed...
    Attached Files Attached Files

  14. #14
    Registered User
    Join Date
    12-15-2017
    Location
    Fresno, CA
    MS-Off Ver
    2016
    Posts
    56

    Re: I'm new to VBA UserForm that can reproduce formulas for totals.

    So basically I could use a basic userform but where I will be using it I have over 1000 unit types to enter so I really don't want to have to write the sum statement including all the columns for column8 on this form. And also the basic userform would be extremely long. So what I would like to do is type in the invoice number. If it exists it will show the data for that invoice number. It will also show the first filled prime key with a number greater than 0. When I click next it will go to the next prime key with a value greater than 0, not the next row. If the index number isn't in the form, it will ask if I would like to create a new invoice. No closes the question and nothing changes. Yes adds that invoice # to the next blank line in the table and I have the ability to choose the prime key and enter a quantity for that prime key. Then click add. Adding does not add a new line, only a new quantity to the prime key currently selected. If there is a quantity already in that prime key I would like a pop up to ask if I'm sure I want to overwrite the current quantity. Close Closes the form and saves the worksheet. Oh and the description shows whatever prime key is chosen so prime key 2 would show the contents of C3 and prime key 3 would show D3 etc.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Reproduce chart
    By Villalobos in forum Excel Charting & Pivots
    Replies: 3
    Last Post: 11-24-2017, 08:03 AM
  2. Min Formulas & Cumulative Totals
    By Frankwalteraussi5000 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 07-28-2017, 07:57 AM
  3. Reproduce speedometer chart
    By Villalobos in forum Excel Charting & Pivots
    Replies: 5
    Last Post: 07-23-2016, 02:53 PM
  4. Running Totals Formulas
    By Jaime in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-03-2005, 02:35 PM
  5. [SOLVED] How do you combine 2 or more formulas with different totals?
    By Trisha V via OfficeKB.com in forum Excel General
    Replies: 22
    Last Post: 08-03-2005, 06:05 PM
  6. [SOLVED] Automatically multiplying totals on a userform
    By Greg B in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-17-2005, 02:08 PM
  7. Totals only (formulas deleted)
    By billy2willy in forum Excel General
    Replies: 3
    Last Post: 03-29-2005, 05:36 PM

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