+ Reply to Thread
Results 1 to 8 of 8

Update Values based on status update

  1. #1
    Forum Contributor
    Join Date
    01-14-2010
    Location
    England
    MS-Off Ver
    2013
    Posts
    110

    Update Values based on status update

    Hi,

    Hope somebody can help, I have the below code but I need help making a few changes. At the moment it -1 if the status is set to "used" and +1 if changed to "returned". However, I would now like it to also look at column 12 (L) for a second status. If column 12 is set to "damaged" or "faulty" I would like it to -1. The other problem is that if I select "used" or "returned" and then select the same status again it changes the value again. So, if i select "used" it will deduct one and then if I select it again my mistake it will deduct another one.



    Please Login or Register  to view this content.
    Hope this makes sense.

    Cheers
    Last edited by JDobbsy1987; 03-12-2017 at 09:38 PM.

  2. #2
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Update Values based on status update

    Maybe:

    Please Login or Register  to view this content.
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  3. #3
    Forum Contributor
    Join Date
    01-14-2010
    Location
    England
    MS-Off Ver
    2013
    Posts
    110

    Re: Update Values based on status update

    Hi,

    Thank you for your help, Not sure if i have done something wrong but i have put the above code in but it doesn't seem to make any changes to the QTY's when changing the statuses.

    The statuses / columns are on a sheet called Parts Usage
    • Used = Colum K
    • Returned = Column K
    • Damaged = Colum L
    • Faulty = Column L

    The number that needs to be updated is on a different tab called Parts Master in column G

    I would like the following to be deducted or added based on the Status entry
    • Used = -1
    • Returned = +1
    • Damaged = -1
    • Faulty = -1

    Can you help update this please?
    I have attached an example sheet.

    Regards,
    Jamie
    Attached Files Attached Files
    Last edited by JDobbsy1987; 03-13-2017 at 01:28 PM.

  4. #4
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Update Values based on status update

    Try it now:

    Please Login or Register  to view this content.
    Last edited by xladept; 03-13-2017 at 04:24 PM. Reason: Change from target row to x

  5. #5
    Forum Contributor
    Join Date
    01-14-2010
    Location
    England
    MS-Off Ver
    2013
    Posts
    110

    Re: Update Values based on status update

    I don't know if I'm doing something wrong but this does not seem to work at all.

    Appreciate any help.

  6. #6
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,167

    Re: Update Values based on status update

    Hi JDobbsy,

    Where you put the code is important. If you put the code behind something called a "Module" it won't work. You need to put it behind the Sheet module. Read:

    http://www.cpearson.com/excel/Scope.aspx
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  7. #7
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Update Values based on status update

    I found a glitch and fixed it - try it again!
    Last edited by xladept; 03-13-2017 at 04:25 PM.

  8. #8
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Update Values based on status update

    Hi JDobbsy,

    Thanks for the rep!

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

+ 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. Replies: 0
    Last Post: 05-13-2014, 01:00 AM
  2. Changing the value in Combobox after update
    By jik_ff in forum Access Programming / VBA / Macros
    Replies: 0
    Last Post: 04-17-2014, 09:34 PM
  3. Update link (Update values) on a protected sheet excel 2010
    By sonu1975 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-03-2014, 09:49 AM
  4. Replies: 5
    Last Post: 12-11-2012, 01:22 PM
  5. Update Cells after changing UDF
    By strokebow in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 11-03-2011, 10:15 AM
  6. changing cell color based on changing values
    By tvonbehren in forum Excel General
    Replies: 2
    Last Post: 09-16-2009, 12:33 PM
  7. Update date when changing a cell
    By leonidas in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-14-2006, 06:20 AM

Tags for this Thread

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