+ Reply to Thread
Results 1 to 5 of 5

Macro Open TXT, format & Compare the list with Excel File..

  1. #1
    Registered User
    Join Date
    06-06-2012
    Location
    Mexico
    MS-Off Ver
    Excel 2010
    Posts
    99

    Lightbulb Macro Open TXT, format & Compare the list with Excel File..

    Dear users!

    I need your help because it's a process that I do every day in my work and I take long time..

    I require a macro to help me compare two lists, but the problem is that 1 file is TXT and other is Excel..

    What do I do?
    1) I open the TXT file with excel.
    2) Give "Text to Columns" format.
    3) At the end asked for the excel file path.
    4) Open the excel file & Compare the 2 lists (txt & excel) and tells me ONLY if the item exists ..
    Please Login or Register  to view this content.

    What do I need help?
    5) Compare the two lists but I compare the whole structure:
    Item Name, Quantity, (not only the Item)

    This is the progress that I have.
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by feroguz; 05-14-2013 at 01:51 PM.

  2. #2
    Forum Expert nilem's Avatar
    Join Date
    10-22-2011
    Location
    Ufa, Russia
    MS-Off Ver
    2013
    Posts
    3,377

    Re: Macro Open TXT, format & Compare the list with Excel File..

    Hi Feroguz,
    try this (if I understood correctly)
    Please Login or Register  to view this content.
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    06-06-2012
    Location
    Mexico
    MS-Off Ver
    Excel 2010
    Posts
    99

    Re: Macro Open TXT, format & Compare the list with Excel File..

    Dear Nilem!!

    I have a problem with this instruction:

    Please Login or Register  to view this content.

    The macro opens the workbook but tells me that is out of range in "x" variable ..

  4. #4
    Forum Expert nilem's Avatar
    Join Date
    10-22-2011
    Location
    Ufa, Russia
    MS-Off Ver
    2013
    Posts
    3,377

    Re: Macro Open TXT, format & Compare the list with Excel File..

    Is there a sheet "Sheet2" in your xlsx file?
    Just in case, here are the files for inspection.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    06-06-2012
    Location
    Mexico
    MS-Off Ver
    Excel 2010
    Posts
    99

    Re: Macro Open TXT, format & Compare the list with Excel File..

    I try to run with files that you attach me (thank you very much)!!

    But now tells me Run-time error 432: nma file or class name not found During Automation Operation.
    I searched in the forums and says that validates my references, Microsoft Active X is enabled ..

    What could it be?, Is something that I missing references? ..

    error.jpgerror2.jpgreferences.jpg

    Thank you for everything!

    EDIT:

    I saw how it worked! ..
    Just that I have to open the workbook before.

    1) I open the workbook with the data that I will run.
    2) I run the macro in another workbook
    3) I asked the TXT
    4) Concatenates the data and displays the information ..
    Last edited by feroguz; 05-15-2013 at 04:05 PM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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