Results 1 to 5 of 5

Transfer data to match rows using VBA

Threaded View

  1. #1
    Registered User
    Join Date
    07-07-2020
    Location
    UK
    MS-Off Ver
    Office 365 - Exel 2016
    Posts
    11

    Transfer data to match rows using VBA

    Hi

    I'm trying to transfer data when it matches a duplicate number on the "bulk loader" sheet, to the "Tracker" sheet and then delete the data that has been copied in the bulkloader sheet, but not the entire row as formulas are held in the other columns. I get an error using the following code, can you see what i'm doing wrong or is there a better way to do this?

    Any help is appreciated.

     Sub transfer()
     Dim i As Long, j As Long, lastrow1 As Long, lastrow2 As Long
     Dim SCode As String
     lastrow1 = Sheets("Bulk Loader").Range("A" & Rows.Count).End(xlUp).Row
    
    For i = 2 To lastrow1
     SCode = Sheets("Bulk Loader").Cells(i, "A").Value
    Sheets("Tracker").Activate
     lastrow2 = Sheets("Tracker").Range("D" & Rows.Count).End(xlUp).Row
    
    For j = 2 To lastrow2
    If Sheets("Tracker").Cells(j, "D").Value = SCode Then
     Sheets("Bulk Loader").Activate
     Sheets("Bulk Loader").Range(Cells(i, "U"), Cells(i, "AA")).Copy
     Sheets("Tracker").Activate
     Sheets("Tracker").Range(Cells(j, "N"), Cells(j, "T")).Select
     ActiveSheet.Paste
     End If
    
    Next j
     Application.CutCopyMode = False
     Next i
     Sheets("Bulk Loader").Activate
     Sheets("Bulk Loader").Range("A1").Select
     End Sub

    Thanks
    Last edited by hyd1956; 07-08-2020 at 11:42 AM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Compare Data in 2 Columns in 2 sheet When there is a match transfer data from 2nd Column
    By kellyjo7 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 05-19-2015, 01:05 PM
  2. Match string values and transfer data
    By GDM69 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 11-24-2014, 01:31 PM
  3. [SOLVED] Match Data from Another Sheet and Transfer Values
    By basketball2524 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-20-2013, 11:49 PM
  4. Replies: 1
    Last Post: 08-24-2013, 07:01 AM
  5. [SOLVED] Match or Loop to Transfer Data from Userform to Sheet
    By cschoyer in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 07-25-2012, 03:06 PM
  6. [SOLVED] Match and Transfer data
    By rizmomin in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-23-2012, 05:46 AM
  7. transfer and match data
    By kant101 in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 08-30-2007, 04:26 AM

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