+ Reply to Thread
Results 1 to 4 of 4

Excel 2007 : Subtract if a cell meets criteria

  1. #1
    Registered User
    Join Date
    07-07-2010
    Location
    Monterrey,Mexico
    MS-Off Ver
    Excel 2003
    Posts
    38

    Subtract if a cell meets criteria

    Hello,

    I think this one is quite simple but i can`t figure it out. I have a user form that carries it`s history to a worksheet every time i press a button. In sheet 1 i have a list of all my inventory products.. Whenever a product goes out my inventory, i fill up this form and click a button. The information of the part and quantity goes to sheet 3 after i click this button.. What i want to do is automatically subtract the information gathered in sheet 3 to my main list in sheet 1.

    For example, if i fill up my form where im taking 2 screwdrivers part#444 , this goes to sheet 3 for history. I also want to subtract 2 screwdrivers from my main list in sheet 1. hope i can get help.

    thanks in advance.

  2. #2
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Subtract if a cell meets criteria

    This could be developed

    In a standard VBa module paste this code
    Please Login or Register  to view this content.

    Put some data in say sheet 1

    Highlight the rows you want to transfer to history

    Run the macro "MoveToHistory"

    Hope this helps
    If you need any more information, please feel free to ask.

    However,If this takes care of your needs, please select Thread Tools from menu above and set this topic to SOLVED. It helps everybody! ....

    Also
    اس کی مدد کرتا ہے اگر
    شکریہ کہنے کے لئے سٹار کلک کریں
    If you are satisfied by any members response to your problem please consider using the small Star icon bottom left of their post to show your appreciation.

  3. #3
    Registered User
    Join Date
    07-07-2010
    Location
    Monterrey,Mexico
    MS-Off Ver
    Excel 2003
    Posts
    38

    Re: Subtract if a cell meets criteria

    Marco,

    Im sendind you the file I`m working on so I can make myself more clear.
    Im using a user form with a couple of buttons. For now, I`m only focusing on the capture button. and what i want this capture button to do is::

    1) take the information as history to sheet 3.. which is working fine now
    2) take away or add parts to my inventory list in sheet one.. As you will see I`m using a multipage, the first tag is used for parts going out of my inventory, and 2nd tag named "entradas" will be used for parts coming in my inventory.. I want to carry a 4th sheet on my workbook for coming in parts, which i haven`t done yet because of my inexperience to use multipages.

    I used the next code to subtract or add from inventory as well using option buttons to define going in or out parts, but i kept getting an error, and decided to do it this other way. The first way, compared whatever was on my list, to the comboboxes (where i have my inventory list as well), and then subtracted or added , depending which option button was checked.. Now, I`m trying to use the form just to carry the information to another sheet.. then I want to do the subtractions from sheet 3 and additions from sheet 4 to my main inventory list on sheet one..

    here`s my old code for the capture button..

    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    07-07-2010
    Location
    Monterrey,Mexico
    MS-Off Ver
    Excel 2003
    Posts
    38

    Re: Subtract if a cell meets criteria

    Marco,

    Im sendind you the file I`m working on so I can make myself more clear.
    Im using a user form with a couple of buttons. For now, I`m only focusing on the capture button. and what i want this capture button to do is::

    1) take the information as history to sheet 3.. which is working fine now
    2) take away or add parts to my inventory list in sheet one.. As you will see I`m using a multipage, the first tag is used for parts going out of my inventory, and 2nd tag named "entradas" will be used for parts coming in my inventory.. I want to carry a 4th sheet on my workbook for coming in parts, which i haven`t done yet because of my inexperience to use multipages.

    I used the next code to subtract or add from inventory as well using option buttons to define going in or out parts, but i kept getting an error, and decided to do it this other way. The first way, compared whatever was on my list, to the comboboxes (where i have my inventory list as well), and then subtracted or added , depending which option button was checked.. Now, I`m trying to use the form just to carry the information to another sheet.. then I want to do the subtractions from sheet 3 and additions from sheet 4 to my main inventory list on sheet one..

    here`s my old code for the capture button..
    attached you will find the new idea i`m working on... The old one seems the right way but can`t figure it out without getting errors after clicking the capture button a couple of times.

    Please Login or Register  to view this content.
    Attached Files Attached Files

+ 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