Excelnoub
Member
Good day,
I am working on enhancing my code. I need to incorporate the following.
I have information in my Wb1 in Sheet1 with Column A:Z. I have data each day to replace in my Wb1. At the end of the month I need to send this info to a workbook (wb2) in the same worksheet (Sheet1) by clicking a Command Button and in the background opening Wb2 looking for the same matching info in my Column A from Wb1 and copy.find the same Value in Wb2 in Column A and Pasting the information from B to Z.
Wb1 will need to make a loop by finding matches in my Column A in my Wb2 if a match is made then copy the row from B to Z from Wb1 then Pasting that range in Wb2 on the same matching row.
Here is a code I am using but for individual selection:
I don’t just need to copy on next available row but have a match and loop from each row in my Wb1 to match.copy and paste the value in my Wb2.
Please help... I have the start but I cannot seem to get the second part done
I am working on enhancing my code. I need to incorporate the following.
I have information in my Wb1 in Sheet1 with Column A:Z. I have data each day to replace in my Wb1. At the end of the month I need to send this info to a workbook (wb2) in the same worksheet (Sheet1) by clicking a Command Button and in the background opening Wb2 looking for the same matching info in my Column A from Wb1 and copy.find the same Value in Wb2 in Column A and Pasting the information from B to Z.
Wb1 will need to make a loop by finding matches in my Column A in my Wb2 if a match is made then copy the row from B to Z from Wb1 then Pasting that range in Wb2 on the same matching row.
Here is a code I am using but for individual selection:
Code:
Private Sub CommandButton3_Click()
Application.ScreenUpdating = False
Application.EnableEvents = False
Set wsSrc = ThisWorkbook.Worksheets("Sheet1")
LastRow = wsSrc.Range("A" & Rows.Count).End(xlUp).row
Set rngSrc = wsSrc.Range("A2:AC" & LastRow)
Set wbArchive = Workbooks.Open(Filename:="My workbook 2 location\Name.xlsm")
Set wsSrc = wbArchive.Worksheets("Sheet1")
Set rngDst = wsSrc.Range("A" & Rows.Count).End(xlUp).Offset(1)
rngSrc.Copy
rngDst.PasteSpecial xlPasteValues
rngSrc.ClearContents
Application.CutCopyMode = False
wbArchive.Close SaveChanges:=True
Range("A5").Select
Application.EnableEvents = True
Application.ScreenUpdating = True
End Sub
I don’t just need to copy on next available row but have a match and loop from each row in my Wb1 to match.copy and paste the value in my Wb2.
Please help... I have the start but I cannot seem to get the second part done