excel - VBA: copy from one sheet into a master and check ID -


i new in vba , programming @ all.

following:

i have "master sheet" data being stored , "edit sheet" data being continuous entered. when data bein entered in edit sheet want copy data when finished.

everything works fine except id being given automatically in edit sheet.

the columns example: id, name, adress, ...

user enteres new entry:

1, marc, new york//

2, pete, new york//

3, sam, london

when copy data master sheet id being copied normally.

now when enter again data in edit sheet id again: 1, jack, la// 2, andre, la//

when copy data again in master sheet looks like:

1, marc, new york//

2, pete, new york//

3, sam, london//

1, jack, la//

2, andre, la

now want unique id new entrys should checked , edited to:

1, marc, new york//

2, pete, new york//

3, sam, london//

4, jack, la//

5, andre, la

ok, let see it.

first, last id master sheet record.

and then, increase 1 , save new data id in edit sheet.

after that, when copy data edit sheet master sheet, can't see duplicate id. try it.

here, example code last id master sheet , edit sheet.

'get last id lastid = worksheetfunction.max(sheets("mastersheet").range("a:a"),sheets("editsheet").range("a:a")) 

Comments