VBA Search and copy (2 Workbooks involved)

longstick

New Member
Joined
Nov 19, 2011
Messages
42
I am looking to automate some updating that I do.

I will try my best to explain.

Book1:
Serial#Cycle CountDateComplete
A464636652520006/06/13Done
D235235223550007/06/13
GC122366720008/06/13

<tbody>
</tbody>


Book2:
Serial #Life Cycle CountLast Updated
F5235231000000
G2352522000000
D235235250000
A4646366500000
GC1223250000

<tbody>
</tbody>


1. Search down the "Complete" column (Column D) to find the next empty cell (Row 3).
2. Check to see if the cell to the left has data. (is there new data that needs to be updated?).
3. Search the serial number from "Book1". Find it in "Book2".
4. Add the Cycle count of the serial number in "Book1" to the Life Cycle count in "Book2"
5. Update the "Last Update" in "Book2" with the date in "Book1"
6. If successful then place "Done" in blank cell found in step 1. If unsuccessful (example: Serial number not found in step 3) then place "Updating Error" in the cell.
6. Repeat until there is no more data in "Column C"


I hope I've explained what I would like.

Could you also place 'notes in the macro explaining what they lines do. I'm trying my best to learn.

Thank you,
 

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.

Forum statistics

Threads
1,215,321
Messages
6,124,239
Members
449,149
Latest member
mwdbActuary

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top