+ Reply to Thread
Results 1 to 2 of 2

Slightly more complicated than simply merging two spreadsheets

Hybrid View

  1. #1
    Registered User
    Join Date
    02-06-2014
    Location
    Maui no ka oi
    MS-Off Ver
    MS 365
    Posts
    9

    Slightly more complicated than simply merging two spreadsheets

    k, so I've got a spreadsheet that I download off a website with the status of a bunch of projects. I usually download the spreadsheet, and go through the list of projects and add my notes, or more information about the job status. But then the spreadsheet on the website gets updated with new jobs, and with new information on the old ones.

    So I'm looking for a way to merge the spreadsheet that I already went through and added my notes and formatting to, with the updated information when I download a new spreadsheet.

    I hope I'm making sense. I attached one example of the file that I formatted and added some info too (a rough one) and I attached the updated spreadsheet that ill download periodically.

    Any ideas on how I can just update some columns with info from the new spreadsheet, and still keep the info I've added? But also add new rows for all the new jobs that I havent looked at yet?

    Thanks in advance, and please let me know if I can clarify at all.
    Attached Files Attached Files

  2. #2
    Forum Expert Tinbendr's Avatar
    Join Date
    06-26-2012
    Location
    USA
    MS-Off Ver
    Office 2010
    Posts
    2,138

    Re: Slightly more complicated than simply merging two spreadsheets

    This assumes that column B is unique.

    In a standard module.
    Sub ImportRecs()
    
    Dim WBSrc As Workbook
    Dim WSDest As Worksheet
    Dim WSSrc As Worksheet
    Dim A As Long
    Dim B As Long
    Dim LRSrc As Long
    Dim LRDest As Long
    Dim FN As String
    Dim C As Range
    
    FN = Application.GetOpenFilename
    
    If FN <> "False" Then
        Application.ScreenUpdating = False
        
        Set WBSrc = Workbooks.Open(FN)
        Set WSSrc = WBSrc.Worksheets(1)
        
        With WSSrc
            LRSrc = .Cells(.Rows.Count, "A").End(xlUp).Row
        End With
        
        Set WSDest = Workbooks("NTP and PA list TB.xlsm").Worksheets(1)
        
        With WSDest
            LRDest = .Cells(.Rows.Count, "A").End(xlUp).Row + 1
            
            For A = 2 To LRSrc
                With .Range("b2:b" & LRDest)
                    Set C = .Find(WSSrc.Range("B" & A), LookIn:=xlValues)
                    If C Is Nothing Then
                        WSSrc.Range("A" & A & ":I" & A).Copy .Cells(LRDest, 0)
                        LRDest = LRDest + 1
                        B = B + 1
                    End If
                End With
            Next
        End With
    End If
    
    WBSrc.Close False
    Application.ScreenUpdating = True
    
    MsgBox "Copied " & B & " items from new report"
    
    End Sub
    David
    (*) Reputation points appreciated.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Finding the Median (Slightly more complicated)
    By paul86 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 07-31-2012, 02:45 PM
  2. Can I get excel to count a date range? but slightly more complicated
    By daybreak in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-07-2011, 04:30 PM
  3. Complicated Merging Problem
    By Callie in forum Excel General
    Replies: 8
    Last Post: 01-30-2010, 12:19 AM
  4. merging slightly different lists together
    By fingraphics in forum Excel General
    Replies: 1
    Last Post: 03-26-2009, 02:29 PM
  5. VBA programming: Simply trying to select cell-- or not so simply?
    By whiteliyl_111 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-10-2005, 01:18 PM

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