Results 1 to 10 of 60

Thread: Vba button Comparison data between two file or two tabs

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #11
    Fuhrer, Vierte Reich DocAElstein's Avatar
    Join Date
    Aug 2014
    Posts
    10,457
    Rep Power
    10
    Hi Thai,
    Quote Originally Posted by Thainguyen View Post
    Hi Alan,
    1. changed the layout of the template and the name of tabs.
    2. Can your code only compare column B,C, E, F and G. I don't need it go through A and D.
    3. the tab for result. Can we just showing the data different instead of all the data because some time we have couple hundred of rows and it will messy to show everything.
    4. If i am deleted some row on sheet2 (NEW). There is notification for that. It should showing on the result as deleted. Or something like part ABC << >> empty.
    Please check our email. i have sent you the sample template but with the new layout

    Your question:3.
    It may be easier and more useful if I explain to you how to do this , because it is very simple:
    There are three code lines that paste out all data to the result Tab
    Each of those three code lines pastes out 2 columns of data in one go
    3(i) To remove data from output
    3(i)a) remove some data
    Remove or 'comment out the code lines corresponding to the data you do not want to display.
    For example, this code modification will remove the displayed data for the original Sheet1 and Sheet2 data
    Code:
    ' Let Ws3.Range("A2").Resize(UBound(arrSht1(), 1), UBound(arrSht1(), 2)).Value = arrSht1()
     Let Ws3.Range("C2").Resize(UBound(arrOut(), 1), UBound(arrOut(), 2)).Value = arrOut()
    ' Let Ws3.Range("E2").Resize(UBound(arrSht2(), 1), UBound(arrSht2(), 2)).Value = arrSht2()
    3(i)b) Remove headings
    If you wish to remove the headings ( Sheet1 Sheet1 Test Output Test Output Sheet2 Sheet2 ) , then simply Remove or 'comment out the code line
    Code:
    ' Let Ws3.Range("A1:B1").Value = "Sheet1": Ws3.Range("C1:D1").Value = "Test Output": Ws3.Range("E1:F1").Value = "Sheet2"

    3(ii) To change position of output
    The range for output is defined by giving the Top left cell of where you want the data, followed by resizing that to the size of the data held in the output array, arrOut().
    __ Range("C2").Resize(UBound(arrOut(), 1), UBound(arrOut(), 2))
    So if you change C2 to A1 , then you will get your data starting at the top left of the worksheet as you wish:
    TopLeftA1.JPG : https://imgur.com/PZAZZlK
    TopLeftA1.JPG

    TopLeftA1 .JPG : https://imgur.com/PZAZZlK
    TopLeftA1 .JPG

    _.___________________________________-
    Your question:4:
    Please try to delete one item on the NEW tab list and use your code. It will not display the different. so it should be good if it can show the different if the item got deleted.
    example Toyota and supra listed on A and B column before and now it got deleted
    .

    This is not a straight forward modification to the existing code. This is because the code modifies the check array , arrSht2Chk() , when checking for the data from sheet1 in sheet2

    One way to solve the problem is to make a second check array, arrSht2ChkKopie(), with identical entries. This is then used in Rem 3b in a Second Loop ##### similar loop to the Main Loop ============
    ( this may not be the most efficient way, as this is often the case when modifications are made in a code )
    The modified code is here : http://www.excelfox.com/forum/showth...0746#post10746
    ( For the purposes of the demo I have not made the changes that I explained above in response to your question 3 )


    Here is an example of the results of the modified code, if I delete, as you suggested, Toyota Supra from Sheet2 : http://www.excelfox.com/forum/showth...0747#post10747

    _._________________________

    Your questions, 1 and 2:
    Quote Originally Posted by Thai
    1. changed the layout of the template and the name of tabs.
    2. Can your code only compare column B,C, E, F and G. I don't need it go through A and D.
    I do not understand exactly what you are asking. Please explain again and I will look at this later

    _.___________________________________
    Your question
    Quote Originally Posted by Thai
    Also, If you can include the display box like the picture below to show how many different item found
    This should not be too difficult to do. I will look at this later

    _._____________

    Alan
    Last edited by DocAElstein; 07-23-2018 at 06:36 PM.
    ….If you are my competitor, I will try all I can to beat you. But if I do, I will not belittle you. I will Salute you, because without you, I am nothing.
    If you are my enemy, we will try to kick the fucking shit out of you…..
    Winston Churchill, 1939
    Save your Forum..._
    KILL A MODERATOR!!

Similar Threads

  1. Link spin button or scroll button to chart.
    By Thainguyen in forum Excel Help
    Replies: 1
    Last Post: 06-08-2018, 04:19 AM
  2. VBA Macro to open a file and extract data
    By jeremiah_j2k in forum Excel Help
    Replies: 0
    Last Post: 05-22-2017, 03:17 PM
  3. Button to export data to a master file
    By aryanaveen in forum Excel Help
    Replies: 0
    Last Post: 01-17-2015, 02:35 AM
  4. Replies: 7
    Last Post: 05-20-2014, 02:10 AM
  5. Replies: 3
    Last Post: 08-28-2013, 02:02 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •