-
Hello, I am new on here also. I am not very good in VBA but I am learning. Yes a Vlookup would work. Assuming you always keep the same sheets. If he always gets new worksheets everytime, this would work. I know there are probably better ways of doing this. But this would work.
If this is too basic or too rough please let me know. I am self taught, so I don't always know the best ways.
[VBA] Sub CopyData()
Dim Book1a As Variant, Book2a As Variant
'Book1 has the source data. The number you want to copy is in the next column over. column B
'Looks in Book2 file for the 1st number.
Windows("book2").Activate
For Each Book2a In Range("a2:a10")
'Looks in Book1 for cooresponding number
Windows("book1").Activate
For Each Book1a In Range("a2:a10")
'When it finds a match, it copies from book1 to book2
If Book1a = Book2a Then
Book1a.Offset(0, 1).Copy
Book2a.Offset(0, 1).PasteSpecial (xlValues)
End If
Next Book1a
Next Book2a
End Sub[/VBA]
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules