Results 1 to 4 of 4

Check for Duplications when transferring data from One Workbook to Master Workbook

Threaded View

  1. #1
    Forum Contributor
    Join Date
    12-19-2012
    Location
    Woodbridge, Virginia
    MS-Off Ver
    Excel 2010
    Posts
    111

    Check for Duplications when transferring data from One Workbook to Master Workbook

    Hello,

    I need your help! I wanted to see if there was a way to check for duplicates before transferring data from one workbook to my master workbook. Is there a way to scan the rows of the master workbook and see if the data being transferred over is a duplicate? Here is the code I am running to copy the data to my master. Please let me know. Any suggestions will be greatly appreciated!

    Sub copyFormToMaster()
    
    
    Application.ScreenUpdating = False
    
    Workbooks.Open FileName:=ThisWorkbook.Path & "\CRForm.xlsm"
    
    
    Windows("CRForm.xlsm").Activate
    Unload requestForm
            
            dataB = Sheets("Database").Range("B2")
            dataC = Sheets("Database").Range("C2")
            dataD = Sheets("Database").Range("D2")
            dataE = Sheets("Database").Range("E2")
            dataF = Sheets("Database").Range("F2")
    
            
    Windows("ChangeRequestMaster.xlsm").Activate
      
    Dim nextRow As Long
    Dim dataSheet As Worksheet
    Set dataSheet = ThisWorkbook.Worksheets("Database")
    
    With dataSheet
    nextRow = .Cells(.Rows.Count, "A").End(xlUp).Offset(1, 0).Row
            With .Cells(nextRow, "A")
                .Value = "ID" & nextRow
            End With
            .Cells(nextRow, "B").Value = dataB
            .Cells(nextRow, "C").Value = dataC
            .Cells(nextRow, "D").Value = dataD
            .Cells(nextRow, "E").Value = dataE
            .Cells(nextRow, "F").Value = dataF
     
            
    End With
    
    Windows("CRForm.xlsm").Activate
    ActiveWindow.Close
    Application.ScreenUpdating = True
    
    End Sub
    Last edited by s2jrchoi; 02-16-2014 at 09:15 AM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Copy paste last row from each workbook in master workbook on header criteria
    By farrukh in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-30-2013, 07:28 AM
  2. Transfer/Copy Data from one workbook to another
    By scottw1988 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 10-26-2012, 09:46 PM
  3. Replies: 2
    Last Post: 09-11-2012, 09:42 AM
  4. Replies: 5
    Last Post: 09-20-2010, 04:58 PM
  5. Transfer figures from workbook to master
    By neodjandre in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-15-2007, 08:04 AM

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