ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Loop for updating data from sheet2 to sheet1 based with some rules (https://www.excelbanter.com/excel-programming/454180-loop-updating-data-sheet2-sheet1-based-some-rules.html)

[email protected]

Loop for updating data from sheet2 to sheet1 based with some rules
 
Dear all,

I like to get a macro to copy data from sheet2 to sheet1 based on some rules.

Sheet1 is the master with thousands of records masterdata in column A (names) and in Column AA, AB till AK registered referencedata.

Sheet2 is the called 'update sheet'. In a normal situation this sheet2 is empty except row1 with the headings. Column AA, AB till AK has the same headings as in sheet1.

When I have to update the specific data of a record in sheet1 (that means updating reference data of column AA, AB till AK) then I fill in, in sheet2, the mastername in column A and in column AA, AB till AK the to update data..

What should the macro do..... it's a loop (sheet2 record 2 till last used and for each record from column AA till AK).


1) Check for each record in sheet2 if the data in column A exist in sheet1 column A. If not then make cell patern of that record in sheet2 column A vbRed and go to next record.

2) If the data in sheet2 column A exist in sheet1 column A then look if column AA has data, if yes, copy this data to the record with the matching name of column A and register the data from sheet2 column AA to sheet1 the same column AA and set the fontcolor green if the cell in sheet1 of that column was empty and set it fontcolor red if there was already data which now is overwrite. Do the same for data in column AB, AC till AK of that record.

Hopely somebody can help me. THANKS!!

regards, Johan







All times are GMT +1. The time now is 05:06 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com