+ Reply to Thread
Results 1 to 7 of 7

Change value based on conditions

  1. #1
    Registered User
    Join Date
    02-06-2013
    Location
    Belgrade, Serbia
    MS-Off Ver
    Excel 2010
    Posts
    5

    Change value based on conditions

    Hi everybody, nice to be here! This forum is a great place and I hope I can get some help here and also help someone!

    I would appreciate some assistance with the following problem:

    I have to program the command button to be able to copy value entered in text box to a cell in another sheet, based on two conditions. Basically, this is supposed to be used for updating some information for customer's database, but for three business segments. Formula should check business segment and customer code (because there are same customers in different business segment). Customer's database is on another sheet. Something like this:

    1.Enter value in text box
    2.Click command button
    3.Formula should check if the two conditions are fulfilled:
    a) check business segment by name: "A", "B" or "C"
    b) check customer code
    4.When two conditions are met, code should copy value from text box to a appropriate cell in same row (for example H3,H4,H5, etc) where are these conditions.
    5.If no condition is met, code should ignore entered value.

    Till now, I've managed only to make this button copy the value to a desired cell, but not based on condition.

    Thanks in advance

  2. #2
    Valued Forum Contributor
    Join Date
    02-09-2012
    Location
    Mauritius
    MS-Off Ver
    Excel 2007
    Posts
    1,055

    Re: Change value based on conditions

    Hi.

    Post sample file for better understanding.
    Click *, if my suggestion helps you. Have a good day!!

  3. #3
    Registered User
    Join Date
    02-06-2013
    Location
    Belgrade, Serbia
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Change value based on conditions

    Hello,

    Here's the simplified version of my project

    Thank you!

    Regards
    Attached Files Attached Files
    Last edited by Vrhovni Bog; 02-25-2013 at 05:34 AM.

  4. #4
    Valued Forum Contributor
    Join Date
    02-09-2012
    Location
    Mauritius
    MS-Off Ver
    Excel 2007
    Posts
    1,055

    Re: Change value based on conditions

    Check this out:

    Sample.xlsm

  5. #5
    Registered User
    Join Date
    02-06-2013
    Location
    Belgrade, Serbia
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Change value based on conditions

    Thanks! But when I click on the button, nothing happens, value in database is not changed. What am I missing?

  6. #6
    Valued Forum Contributor
    Join Date
    02-09-2012
    Location
    Mauritius
    MS-Off Ver
    Excel 2007
    Posts
    1,055

    Re: Change value based on conditions

    In your sample file, Customer 1 has 2 segment values:A and B for the same customer code. How do you differentiate which segment to refer?

  7. #7
    Registered User
    Join Date
    02-06-2013
    Location
    Belgrade, Serbia
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Change value based on conditions

    Well, I was thinking about putting the filter for the business segment to overcome this issue.

    Maybe I was little confusing, sorry about that.

+ 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