+ Reply to Thread
Results 1 to 16 of 16

add & subtract values from userform to specific column in sheet

  1. #1
    Forum Contributor
    Join Date
    06-02-2019
    Location
    libya
    MS-Off Ver
    2010
    Posts
    734

    add & subtract values from userform to specific column in sheet

    hi, i have this code for mr. sintek i would amending by make it add & subtract values i have two userform first add values to col e and the same thing the userform 2 but subtract when i use data from multiple combobox based on data in sheet1 from a2:d and fill the value in textbox should change this brand add as in userform1 or subtract as userform2
    HTML Code: 
    Attached Files Attached Files

  2. #2
    Forum Expert torachan's Avatar
    Join Date
    12-27-2012
    Location
    market harborough, england
    MS-Off Ver
    Excel 2010
    Posts
    4,304

    Re: add & subtract values from userform to specific column in sheet

    not too clear what you are wanting to do.
    the code just adds another complete row of a combination of your comboboxes and textbox.
    Are you in fact wanting to increase or decrease the value in column E ????
    torachan.

  3. #3
    Forum Contributor
    Join Date
    06-02-2019
    Location
    libya
    MS-Off Ver
    2010
    Posts
    734

    Re: add & subtract values from userform to specific column in sheet

    hi, torachan
    Quote Originally Posted by torachan View Post
    not too clear what you are wanting to do.
    the code just adds another complete row of a combination of your comboboxes and textbox.
    Are you in fact wanting to increase or decrease the value in column E ????
    torachan.
    yes , i'm wanting do that when i choose from multiple combox if is already existed then just increase by userform1 or decrease by userform2 and if data not existed then add data in lastrow
    i hope this help

  4. #4
    Forum Expert torachan's Avatar
    Join Date
    12-27-2012
    Location
    market harborough, england
    MS-Off Ver
    Excel 2010
    Posts
    4,304

    Re: add & subtract values from userform to specific column in sheet

    your approach to the problem is somewhat alien to me.
    do you have 3 brands with the same code.
    you need some method to check if item is list before entry to prevent duplicates.
    this appears a typical stock control excerise, first establish your stock descriptions, codes etc.
    then apply a stock in/out/balance procedure.

  5. #5
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,236

    Re: add & subtract values from userform to specific column in sheet

    For add userform use below...For subtract userform use same but change red + to -

    Please Login or Register  to view this content.
    Last edited by sintek; 09-12-2020 at 12:48 PM.
    Good Luck
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the star to left of post [Add Reputation]
    Also....add a comment if you like!!!!
    And remember...Mark Thread as Solved.
    Excel Forum Rocks!!!

  6. #6
    Forum Contributor
    Join Date
    06-02-2019
    Location
    libya
    MS-Off Ver
    2010
    Posts
    734

    Re: add & subtract values from userform to specific column in sheet

    thanks sintek for astonishing code but i would last thing after press command button whether add or subtract if is possible show the message gives me information the brand become value for instance the message is like this " theses brand 20w50 208l become 122 quantity and 20w50 12 X1l became 112 quantity so the message based on col c,e

  7. #7
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,236

    Re: add & subtract values from userform to specific column in sheet

    so the message based on col c,e
    Col B,E you mean...


    Add this snippet...
    Please Login or Register  to view this content.
    After
    Please Login or Register  to view this content.

  8. #8
    Forum Contributor
    Join Date
    06-02-2019
    Location
    libya
    MS-Off Ver
    2010
    Posts
    734

    Re: add & subtract values from userform to specific column in sheet

    thanks sintek for all theses codes and your correcting about clo b , e not c, e you solved my two threads today
    god bless you
    Last edited by ABDELFATTA; 09-12-2020 at 05:48 PM.

  9. #9
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,236

    Re: add & subtract values from userform to specific column in sheet

    All good.....
    Last edited by sintek; 09-13-2020 at 05:31 AM.

  10. #10
    Forum Contributor
    Join Date
    06-02-2019
    Location
    libya
    MS-Off Ver
    2010
    Posts
    734

    Re: add & subtract values from userform to specific column in sheet

    hi, sintek i have found error type mismatch in the code if i fill data not match in what contain the sheet in this line
    HTML Code: 
    if there is way when not match data then show message box "not match" and exit sub " i appreciate that

  11. #11
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,236

    Re: add & subtract values from userform to specific column in sheet

    My bad...x must be Chk
    Please Login or Register  to view this content.
    Last edited by sintek; 09-13-2020 at 05:03 AM.

  12. #12
    Forum Contributor
    Join Date
    06-02-2019
    Location
    libya
    MS-Off Ver
    2010
    Posts
    734

    Re: add & subtract values from userform to specific column in sheet

    what i fill in multiple combobox on userform it supposes the same what is existed in the sheet to add or subtract
    for instance the data in sheet for specific brand is AA 20-W50 208L Q8 THI 124 but if i fill on user form differently like this
    AA 20-W50 208L cas THI 5 as you see in col 3 not match as what existed in the sheet so the code can't run correctly because not match
    i hope this help

  13. #13
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,236

    Re: add & subtract values from userform to specific column in sheet

    See Edited Post 11

  14. #14
    Forum Contributor
    Join Date
    06-02-2019
    Location
    libya
    MS-Off Ver
    2010
    Posts
    734

    Re: add & subtract values from userform to specific column in sheet

    yes ,add the data which not matched but it not show message after copy data to sheet

  15. #15
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,236

    Re: add & subtract values from userform to specific column in sheet

    Not gonna spoon feed you anymore...Add MsgBox code snippet where you want it...

  16. #16
    Forum Contributor
    Join Date
    06-02-2019
    Location
    libya
    MS-Off Ver
    2010
    Posts
    734

    Re: add & subtract values from userform to specific column in sheet

    thanks sintek for every thing

+ 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] VBA to Search for Multiple Values in a column on a specific sheet
    By LKERN in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-31-2019, 04:14 PM
  2. vba to subtract two column values and add new too if added in second sheet
    By ROHAN999 in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 09-18-2018, 03:02 PM
  3. [SOLVED] How to return specific column values in a separate sheet
    By MyStix01 in forum Excel General
    Replies: 7
    Last Post: 06-29-2018, 12:43 AM
  4. Subtract values without change value in specific cell
    By marreco in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-19-2017, 03:34 PM
  5. [SOLVED] Subtract two date colums and count rows with specific values
    By waylynjohnston1 in forum Excel Formulas & Functions
    Replies: 13
    Last Post: 11-06-2016, 06:45 PM
  6. VBA UserForm - Contact sheet; Using a ComboBox array to write data to specific column
    By willmason in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-01-2014, 09:44 AM
  7. [SOLVED] Populate summary sheet with values within specific month column on data sheet...
    By blue91 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 06-12-2013, 12:11 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