+ Reply to Thread
Results 1 to 6 of 6

!

  1. #1
    Registered User
    Join Date
    03-18-2013
    Location
    London
    MS-Off Ver
    Excel 2007
    Posts
    3

    Unhappy !

    Hi

    I am new to VBA with excel and I was wondering if anyone could help me with my problem.

    I have a sheet with 800 rows. There are various columns. I am currently trying to do a test on 2 columns called "Tax Code" and "Company". Tax Code has 5 values only - S1,S2,P1,P2,P5.

    The company has various company names.

    If there are multiple entries for a company they should technically all have the same tax code. Say for example, there are 5 entries for Wipro, all five should have tax code say S1.
    I need to find out the companies with multiple tax codes. Say 2 entries for Aviva has S2 and one has P1 hence, its an exception and i need to find them.

    Attached an example

    Thanks
    Attached Files Attached Files
    Last edited by arlu1201; 04-03-2013 at 02:32 AM. Reason: Do not clear the contents of your 1st post.

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,933

    Re: multiple entries for a company should technically all have the same tax code

    Hi and welcome to the forum

    I have looked at your file, and dont see any "Company" column, nor do I find any company called Wipro?
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Registered User
    Join Date
    03-18-2013
    Location
    London
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: multiple entries for a company should technically all have the same tax code

    Hi
    Sorry that was just an example.
    the columns used are Tax Code and Customer/Supplier name.

  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,933

    Re: multiple entries for a company should technically all have the same tax code

    OK, try this....

    in Q, copied down, use this...=M2&B2

    Then copy column C to S and use "remove duplicates" to give you a list of unique companies
    Tax Code has 5 values only - S1,S2,P1,P2,P5.
    These are the actual codes you have in that file.....S1 S2 P1 P2 P5 P7

    I added those as headings to T1:Y1, then in T2, copied down and across, I used this...
    =COUNTIF($Q:$Q,$S2&T$1)
    in column Z, use this, copied down...
    =IF(COUNTIF(T2:Y2,"<>0")<=1,"",COUNTIF(T2:Y2,"<>0"))

    You will see from this that out of 91 different companies, 21 have multiple tax codes

  5. #5
    Registered User
    Join Date
    03-18-2013
    Location
    London
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: multiple entries for a company should technically all have the same tax code

    I can do it using excel.
    I was actually looking for a VBA code.

  6. #6
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: !

    chhavi,

    Please take a moment to read the forum rules and then amend your thread title to something descriptive of your problem. Once you have done this please send me a PM and I will remove this request.

    To change a Title on your post, click EDIT then Go Advanced and change your title, if 2 days have passed ask a moderator to do it for you.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

+ 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