+ Reply to Thread
Results 1 to 15 of 15

add/subtract using action button

  1. #1
    Registered User
    Join Date
    06-12-2010
    Location
    Hereford, England
    MS-Off Ver
    Excel 2003
    Posts
    73

    add/subtract using action button

    Hi, my problem is similar to the problem another member had but I'm more of a novice when it comes to VBA. Here is the link to his:
    http://www.excelforum.com/excel-work...rom-total.html
    My problem is this: I have a list of products and their quantities on sheet 1(Database). The products are listed in Column A, the quantities in Column C.
    I have another sheet named (Adjustments). This is what I'd like in this sheet. A1 would be the product name, B1 would be minus, C1 would be plus. At the end of the row would be a submit button. When the submit button is clicked, the details of row 1 are dropped into a table below and row 1 is cleared for another entry. The next entry is dropped into the table, below the first entry, so on and so forth until all adjustments are made. When finished entering adjustments I want a save and print button that when clicked will make the minus or plus adjustments to the (Database) for each product entered, print & then clear the table.

    As I said, I'm a virtual novice when it comes to VBA so a step by step guide on how I can achieve this goal would be very much appreciated.

    Hoping that one of you excel genius's can help me with this.
    Last edited by Baziwan; 06-19-2010 at 06:15 AM.

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: add/subtract using action button

    To best describe or illustrate your problem you would be better off attaching a dummy workbook, the workbook should contain the same structure and some dummy data of the same type as the type you have in your real workbook - so, if a cell contains numbers & letters in this format abc-123 then that should be reflected in the dummy workbook.

    If needed supply a before and after sheet in the workbook so the person helping you can see what you are trying to achieve.

    Doing this will ensure you get the result you need!
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Registered User
    Join Date
    06-12-2010
    Location
    Hereford, England
    MS-Off Ver
    Excel 2003
    Posts
    73

    Re: add/subtract using action button

    Thanks Roy, I'll mock up a dummy workbook and post it in a while. Just gotta watch the England match first though.

  4. #4
    Registered User
    Join Date
    06-12-2010
    Location
    Hereford, England
    MS-Off Ver
    Excel 2003
    Posts
    73

    Re: add/subtract using action button

    OK, I've attached an example that will give an idea of what I'm after.
    On the adjustments worksheet when you fill the information in row 2 and click submit, the info drops into the table below & row 2 clears. Keep entering info in row 2 until you've finished. Then you click Confirm & Print. This will then adjust the quantities on the Database worksheet accordingly, print a copy of the Adjustments Table and clear the information.

    Hope you can help
    Attached Files Attached Files
    Last edited by Baziwan; 06-12-2010 at 04:42 PM.

  5. #5
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: add/subtract using action button

    I've added a couple of named Ranges for the code to use.

    See if this is what you wanted
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    06-12-2010
    Location
    Hereford, England
    MS-Off Ver
    Excel 2003
    Posts
    73

    Re: add/subtract using action button

    Hi Roy,
    Thanks, you are a star. That's exactly what I was looking for.
    The problem I have now is that I'm new to VBA. It's like learning to read & write all over again.
    In order to apply and adjust it to my worksheet I need to understand what function each line of the code is performing. I know that I'm putting on you a little but is there a chance you can give me a breakdown of the codes used.
    Thanks in advance

  7. #7
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: add/subtract using action button

    Does this help?
    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    06-12-2010
    Location
    Hereford, England
    MS-Off Ver
    Excel 2003
    Posts
    73

    Re: add/subtract using action button

    Excellent. Thanks.
    Hopefully with some experimentation I'll be able to put it into practice.
    I'm gonna mark this thread as solved. If I have any problems, is it ok if I come back to you Via PM?
    Once again thanks, you've been very helpful!!

  9. #9
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: add/subtract using action button

    Any questions post in this thread,PM me if I don't spot it

  10. #10
    Registered User
    Join Date
    06-12-2010
    Location
    Hereford, England
    MS-Off Ver
    Excel 2003
    Posts
    73

    Re: add/subtract using action button

    Hi Roy,

    Back again, I Suck!!

    I've had to make changes to the structure of my database imput sheet. I've manged to adapt the 1st sub command and the date command for the imput sheet but I'm lost when it comes to the "With Range(vba_form) commands". I've attached the blank canvass. You can see that in the database the products are in (column A), the quantities in (column C). Whereas in the input sheet the Products are in column B.
    I thought that I might be able to figure it out, but I'm afraid that it's left me feeling like an England football player!! (deflated).

    Sorry to be such a pain in the butt.
    Last edited by Baziwan; 07-04-2010 at 09:10 AM.

  11. #11
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: add/subtract using action button

    I don't understand the change to the database, what's Row 5 & Row 2for? You've blacked themout

  12. #12
    Registered User
    Join Date
    06-12-2010
    Location
    Hereford, England
    MS-Off Ver
    Excel 2003
    Posts
    73

    Re: add/subtract using action button

    Hi Roy, Yeah they're just formats to identify a change in information. I can send you the excel file including info if it'll help but I'd prefer to do that privately.

  13. #13
    Registered User
    Join Date
    11-09-2012
    Location
    Pennsylvania,USA
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: add/subtract using action button

    I am trying to create an inventory for tires.

    Id like to add function to the 2 buttons i created...to add & to subtract from an inventory list located on another worksheet. If the tire size entered is not available, id like to use the same add button to add it to include the entered tire size into the inventory list.

    Ive tried using this thread as some guidence, but im not familiar with the code or how to manipulate it to do what id like it to. Im hopeful i can get some help here!
    Attached Files Attached Files
    Last edited by Samantha1123; 11-12-2012 at 02:44 AM. Reason: Added workbook

  14. #14
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,167

    Re: add/subtract using action button

    Samantha1123,

    Welcome to the Forum, unfortunately:

    Your post does not comply with Rule 2 of our Forum RULES. Don't post a question in the thread of another member -- start your own thread. If you feel it's particularly relevant, provide a link to the other thread. It makes sense to have a new thread for your question because a thread with numerous replies can be off putting & difficult to pick out relevant replies.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

  15. #15
    Registered User
    Join Date
    11-09-2012
    Location
    Pennsylvania,USA
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: add/subtract using action button

    Thank you!

+ 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