+ Reply to Thread
Results 1 to 17 of 17

VBA Code to cross check the multiple sheets and based on certain criteria, return a value

  1. #1
    Registered User
    Join Date
    11-11-2018
    Location
    London, England
    MS-Off Ver
    2016
    Posts
    29

    VBA Code to cross check the multiple sheets and based on certain criteria, return a value

    Dear respected Excel specialists,

    I am turning to you and politely asking for your help with the final project. I would like to ask you if you could help me obtain, or rather direct me, what would be the best way to carry out the desired "action". I was thinking that just to be safe, I would use VBA code that would run in the background. I am also attaching a draft Excel document, which unfortunately is "generalized" due to data protection, but is in the same format.

    My wish is that when a new customer is entered, the program would check columns #1, #2, #3, #4, where the mark is "x" and it would automatically transfer the customer to the appropriate tab. A manual example of "Microsoft" can be checked where "x" is at column #1 and column #2, so it was also added to tab #1 and tab #2 - manually.

    After this, I wish that the "x" marks would turn into, let's say green background based on a "Customer Status" in below tabs (#1, #2, #3, #4) - again example for Microsoft. Since both statuses are "Valid Customers", the "x" marks are green and in the "Customers" tab the Customer status will also be "Valid Customer" - since it is active.

    In addition to the above, I also wish to add a condition, that the "Customer Status" in "Customers" tab will stay "Valid Customer" as long as one of the columns (#1, #2, #3, #4) has a green x.

    Let's say that Microsoft, does not want to continue the partnership in column #2, the customer status in tab #2, would be changed into "Former Customer" and the "x" mark in "Customers" tab, would still be there, but changed into red background instead of green. So at this point we have Microsoft that has a status of a "Valid Customer" in tab #1, status of "Former Customer" in tab #2 so that customer status in "Customers" tab would still be Valid Customer with a green "x" mark on #1 and red "x" mark on #2.

    Now let's say that Microsoft decided to cancel every partnership, so now the #1 tab customer status would be again changed from "Valid Customer" to "Former Customer". In "Customers" tab, the customer status will now be changed into "Former Customer" as both areas are no longer active and the x marks should be highlighted with the red background.

    I hope I was able to explain my wishes and I do know that this could be a lot of work so any information or assistance is really appreciated. Should anyone require any additional information, please do not hestitate to ask and I will try my best to provide them.

    Kind regards,
    Attached Files Attached Files
    Last edited by Terror9; 08-18-2022 at 05:01 AM.

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2505 (Windows 11 Home 24H2 64-bit)
    Posts
    91,231

    Re: VBA Assistance - Project

    Administrative Note:

    We would very much like to help you with your query, however the thread title does not really convey what your request is about. Tell us what you are trying to do, not how you think it should be done.

    Please take a moment to amend your thread title. Make sure that the title properly explains your request. Your title should be explicit and not be generic (this includes function names used without an indication of what you are trying to achieve).

    Please see Forum Rule #1 about proper thread titles and adjust accordingly. To edit the thread title, open the original post to edit and then click on Go Advanced (bottom right) to access the area where you can edit your title.

    (Note: this change is not optional. No help to be offered until this moderation request has been fulfilled.)
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

  3. #3
    Registered User
    Join Date
    11-11-2018
    Location
    London, England
    MS-Off Ver
    2016
    Posts
    29

    VBA Code to cross check the multiple sheets and based on certain criteria, return a value

    Dear AliGW,

    thank you for reply.

    I would like to apologize for the bad address and for not following the forum rules. I hope the title is more correct this time.

    Kind regards,

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2505 (Windows 11 Home 24H2 64-bit)
    Posts
    91,231

    Re: VBA Assistance - Project

    Fine, but it needs to be changed in the opening post, please. Once this is done, someone can offer some support. Please do this NOW. Thanks.

  5. #5
    Registered User
    Join Date
    11-11-2018
    Location
    London, England
    MS-Off Ver
    2016
    Posts
    29

    VBA Code to cross check the multiple sheets and based on certain criteria, return a value

    Dear AliGW,

    The title has been changed as requested. I do hope everything is correct this time.

    Kind regards,

  6. #6
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2505 (Windows 11 Home 24H2 64-bit)
    Posts
    91,231

    Re: VBA Code to cross check the multiple sheets and based on certain criteria, return a va

    Perfect - thank you.

  7. #7
    Valued Forum Contributor
    Join Date
    08-08-2022
    Location
    Buenos Aires
    MS-Off Ver
    Excel 2019
    Posts
    1,777

    Re: VBA Code to cross check the multiple sheets and based on certain criteria, return a va

    Hi.
    I don't like your data model because I find it impractical.
    That's why I show you a variant:

    v : Valid Customer
    f : Former Customer

    Change any "v" to "f", scroll to the respective sheet and check.

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by beyond Excel; 08-18-2022 at 01:24 PM.

  8. #8
    Registered User
    Join Date
    11-11-2018
    Location
    London, England
    MS-Off Ver
    2016
    Posts
    29

    Re: VBA Code to cross check the multiple sheets and based on certain criteria, return a va

    Dear beyond Excel,

    I am so sorry for providing you with impractical data base, but I would also like to thank you for the solution. It works perfectly.

    Appreciate it a lot.

    Kind regards,

  9. #9
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2505 (Windows 11 Home 24H2 64-bit)
    Posts
    91,231

    Re: VBA Code to cross check the multiple sheets and based on certain criteria, return a va

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

    Also, if you have not already done so, you may not be aware that you can thank those who have helped you by clicking the small star icon (* Add Reputation) located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of all those who offered help.

  10. #10
    Registered User
    Join Date
    11-11-2018
    Location
    London, England
    MS-Off Ver
    2016
    Posts
    29

    Re: VBA Code to cross check the multiple sheets and based on certain criteria, return a va

    Dear AliGW and beyond Excel,

    thank you for the further instructions. I would require just a little bit further assistance if it would be possible. I have expended / added additional columns.

    Would you be so kind and please explain or show me, which line should I change in order to expand and to copy the results from all extra columns. I have uploaded the excel file.

    I would also like to add, that the status in "Customers" Sheet is added automaticly, based on other status. If 1 status is "e" (existing customer), than the status will be existing customer, however if all of them are "f" (former customer) the status will be changed to former customer.

    I guess I could make the uppoer request with an If sentance, but I would rather have it in VBA - if it is not too much trouble to ask for.

    Thank you in advance.
    Attached Files Attached Files

  11. #11
    Valued Forum Contributor
    Join Date
    08-08-2022
    Location
    Buenos Aires
    MS-Off Ver
    Excel 2019
    Posts
    1,777

    Re: VBA Code to cross check the multiple sheets and based on certain criteria, return a va

    Hi.
    The attached model is simpler than the previous one. Simply: you will "double-click" on #1, #2, #3, #4, #5 (all the columns you need inside the ListObject)... and a sheet with the linked information will open.

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

  12. #12
    Registered User
    Join Date
    11-11-2018
    Location
    London, England
    MS-Off Ver
    2016
    Posts
    29

    Re: VBA Code to cross check the multiple sheets and based on certain criteria, return a va

    Dear beyond Excel,

    thank you so much for your reply.

    Unfortunately, I didn't quite understand what exactly changed. So If you would be so kind and explain it a little bit further. (Sorry I'm a bit DUMB)

    So in general, I have added additional columns in Customer sheet. These columns would have some information, that would also be automaticly copied to the correct sheet if the value "v" would be in that column. You may check the example in my previously uploaded excel file.

    Addition to the above, I have a "satus" column empty (in Customer sheet), that would be automaticly changed, based on the statuses in sheets #1, #2, #3, #4. So if everyone of these would be f, the status would be former, if one of them would be v the status would be Existing.

    Looking forward hearing from you.

    Kind regards,

  13. #13
    Valued Forum Contributor
    Join Date
    08-08-2022
    Location
    Buenos Aires
    MS-Off Ver
    Excel 2019
    Posts
    1,777

    Re: VBA Code to cross check the multiple sheets and based on certain criteria, return a va

    .
    My friend: double click on cell J1 and see what happens.
    .

  14. #14
    Registered User
    Join Date
    11-11-2018
    Location
    London, England
    MS-Off Ver
    2016
    Posts
    29

    Re: VBA Code to cross check the multiple sheets and based on certain criteria, return a va

    Dear beyond Excel,

    thank you for the update. It looks amazing, but I would prefer to have the seperate sheets shown below. Also, the columns from "Customers" Sheet are not fully being copied. If it would be possible to copy all the columns (from A to G) to the sheet where the value is "v".

    Thank you in advance for your time and help.

    Kind regards,

  15. #15
    Valued Forum Contributor
    Join Date
    08-08-2022
    Location
    Buenos Aires
    MS-Off Ver
    Excel 2019
    Posts
    1,777

    Re: VBA Code to cross check the multiple sheets and based on certain criteria, return a va

    OK Take a look at this version:

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

  16. #16
    Registered User
    Join Date
    11-11-2018
    Location
    London, England
    MS-Off Ver
    2016
    Posts
    29

    Re: VBA Code to cross check the multiple sheets and based on certain criteria, return a va

    Dear beyond Excel,

    thank you so much for your time and effort. This looks amazing.

    I would still prefer that the columns named #1, #2, #3, #4, would be shown in the "sheet area" instead of clicking on them in order for them to open. I would also like that, the status of a client is also added in "Customer Sheet" where it would change automaticly based on values of a status in sheet #1, #2, #3, #4. For example if one of them is "valid" it is an existing customer if everyone is former it is a former customer.

    Thank you in advance.
    Kind regards,

  17. #17
    Registered User
    Join Date
    11-11-2018
    Location
    London, England
    MS-Off Ver
    2016
    Posts
    29

    Re: VBA Code to cross check the multiple sheets and based on certain criteria, return a va

    Dear beyond Excel,

    I hope everything is well on your end.

    I was wondering if you were able to take a look at my wishes?

    Kind regards,

+ 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. Project assistance-Web Data and weighted averages
    By Bobcatbuckface in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 02-26-2019, 03:30 PM
  2. Replies: 3
    Last Post: 08-11-2017, 03:10 AM
  3. Replies: 1
    Last Post: 06-12-2017, 09:20 PM
  4. Financial Formulas & Rolling Returns in Excel
    By gec888 in forum Excel General
    Replies: 1
    Last Post: 12-28-2015, 04:24 AM
  5. [SOLVED] Assistance with Summary of Employee Non Project Calendar
    By Cidona in forum Excel - New Users/Basics
    Replies: 10
    Last Post: 01-11-2015, 05:18 PM
  6. Replies: 5
    Last Post: 08-06-2014, 01:10 PM
  7. Replies: 4
    Last Post: 04-18-2014, 12:09 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