+ Reply to Thread
Results 1 to 8 of 8

Macro to consolidate the data from mutliple files using Vlookup / Match

  1. #1
    Registered User
    Join Date
    08-25-2011
    Location
    Chennai, India
    MS-Off Ver
    Excel 2007
    Posts
    31

    Macro to consolidate the data from mutliple files using Vlookup / Match

    Hello,

    I am looking for a Macro to copy the data from multiple excel files to single file.

    Here it goes:

    I have mutiple excel files in one location named as DownTime3_6_2012_1_23 (File saved at 1:23 on 3/6/2012), DownTime3_5_2012_14_21, and so on.......... Now I want the Macro to create a consolidated report which will already have the server list updated in Column A of result file (ConsolidatedResult.xls) and it need to do the Vlookup/Match with the files and copy the data as per the attached sample file (ConsolidatedReport.xls).

    Any help would be appreciated.

    Regards,
    Pradeep
    Attached Files Attached Files
    Last edited by pradeepkodali; 03-08-2012 at 01:47 PM. Reason: Updated correct sample file

  2. #2
    Registered User
    Join Date
    08-25-2011
    Location
    Chennai, India
    MS-Off Ver
    Excel 2007
    Posts
    31

    Re: Macro to consolidate the data from mutliple files using Vlookup / Match

    I am able to get the result using the below formula manually, Please help me with Macro.

    =IFERROR(VLOOKUP(A2,[DownTime3_5_2012_14_21.xls]Sheet1!$A:$B,2,0)/60,"Not Pingable")

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

    Re: Macro to consolidate the data from mutliple files using Vlookup / Match

    Try it. All files must be placed in one folder.(IFERROR works in Excel2007(10))
    Please Login or Register  to view this content.
    You can change this line if you use the date format mm:dd:yyyy
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by nilem; 03-07-2012 at 03:58 AM.

  4. #4
    Registered User
    Join Date
    08-25-2011
    Location
    Chennai, India
    MS-Off Ver
    Excel 2007
    Posts
    31

    Re: Macro to consolidate the data from mutliple files using Vlookup / Match

    Thanks for the code Nilem, Its copying the data in Consolidated sheet but I am getting the same date twice one with correct data and other with previous date data. I have attached the result sheet. Please have a check.

    P.S: I will have around 30 + files in same folder and the Macro need to pull the information of all the files. Also it’s not taking the date from the name of the file (I have changed 3_5_2012 to 3_21_2012 but it is still showing the same date as 5/3/3012, 6/3/2012 & 6/3/2012 in Consolidated).

    I have the files in my desktop and the formula looks like below

    for 3/5/2012

    =IFERROR(VLOOKUP($A2,'C:\Documents and Settings\Administrator\Desktop\New Folder\[DownTime3_5_2012_14_21.xls]Sheet1'!$A$1:$B$65536,2,0)/60,"Not Pingable")

    for 3/6/2012

    =IFERROR(VLOOKUP($A2,'C:\Documents and Settings\Administrator\Desktop\New Folder\[DownTime3_6_2012_1_23.xls]Sheet1'!$A$1:$B$65536,2,0)/60,"Not Pingable")

    For 3/7/2012
    =IFERROR(VLOOKUP($A2,'C:\Documents and Settings\Administrator\Desktop\New Folder\[DownTime3_7_2012_4_23.xls]Sheet1'!$A$1:$B$65536,2,0)/60,"Not Pingable")

    and so on...

    what does C1:C2 does in the below formula?

    Please Login or Register  to view this content.
    Regards,
    Pradeep
    Attached Files Attached Files
    Last edited by pradeepkodali; 03-07-2012 at 05:19 AM. Reason: added formula's

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

    Re: Macro to consolidate the data from mutliple files using Vlookup / Match

    "what does C1:C2 does in the below formula Sheet1!C1:C2?"
    C1 means column#1 (range A:A), C2 - column#2 (range B:B) on sheet Sheet1.
    Try this option (date formate mm:dd:yyyy).
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    08-25-2011
    Location
    Chennai, India
    MS-Off Ver
    Excel 2007
    Posts
    31

    Re: Macro to consolidate the data from mutliple files using Vlookup / Match

    Thanks for the explanation Nilem. Its working great.

    If I want to execute the same Macro in 2003, do we have any alternate formula for IFERROR?

    Regards,
    Pradeep

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

    Re: Macro to consolidate the data from mutliple files using Vlookup / Match

    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    08-25-2011
    Location
    Chennai, India
    MS-Off Ver
    Excel 2007
    Posts
    31

    Re: Macro to consolidate the data from mutliple files using Vlookup / Match

    Thanks Nilem. I will have a test on 2003 and let you know incase of any issues.

    Once again Thank You very much....

+ 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