Extract Records from Two Opened Workbooks based on A Column

vikas_newports

Board Regular
Joined
May 26, 2016
Messages
121
Office Version
  1. 365
Platform
  1. Windows
Hello
I want to extract the difference between two excel files and save it to my Maco files sheet name (NEW_RECORDS)
File Names changes on daily basis so I am selecting Files manually

File1 have old records and File 2 have new records. I am finding the new records based upon Column C (Account IDs)
I am using vlookup before automating it

I need your suggestion to achieve it.
my code is as under

VBA Code:
Sub New_Records()

    Application.DisplayAlerts = False
    Application.ScreenUpdating = False
    Dim FileToOpen As Variant
    Dim OpenBook As Workbook
    Dim FileToOpen1 As Variant
    Dim OpenBook1 As Workbook
    
        'Select File to be Open
    FileToOpen = Application.GetOpenFilename(Title:="Select File1", FileFilter:="CSV Files (*.csv*),*csv*")
    If FileToOpen <> False Then
        Set OpenBook = Application.Workbooks.Open(FileToOpen)
        
    End If
    Application.ScreenUpdating = True
    
    
            'Select File to be Open
    FileToOpen1 = Application.GetOpenFilename(Title:="Select File2", FileFilter:="CSV Files (*.csv*),*csv*")
    If FileToOpen1 <> False Then
        Set OpenBook1 = Application.Workbooks.Open(FileToOpen1)
        
    End If
    Application.ScreenUpdating = True

End Sub
 

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
56,562
Office Version
  1. 365
Platform
  1. Windows
Cross-posting (posting the same question in more than one forum) is not against our rules, but the method of doing so is covered by #13 of the Forum Rules.

Be sure to follow & read the link at the end of the rule too!

Cross posted at: compare two excel files and extract differences [SOLVED]
If you have posted the question at more places, please provide links to those as well.

If you do cross-post in the future and also provide links, then there shouldn’t be a problem.
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
56,562
Office Version
  1. 365
Platform
  1. Windows
No idea, but you've marked it as solved on EF.
 

Watch MrExcel Video

Forum statistics

Threads
1,129,592
Messages
5,637,291
Members
416,963
Latest member
zazama

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top