I have a vba formula that opens another workbook, matches the heading and paste the data in the last row +1
now I want to integrate a check function that makes sure that data isn't already pasted and if so skip the rest of the formula and pop a msg box up saying data already there..
2 problems I cant for the life of me work out how to integrate the match into the current formula
I have
col = 22
lastrow =11
data is currently in rows 5 to 11 in column 22
I need to match wsSource.Range("C3").Value with data in Row 5 to 11 on column 22 and if it matches then skip the rest of the formula that would paste it at the end.
the skip part of the code im trying is
and 2. how do I go to a skip point without it being run if its not skipped. As I put it at the bottom of the macro but if it doesnt skip (as I havent finished skip yet) it still ends up reading out my msgbox
now I want to integrate a check function that makes sure that data isn't already pasted and if so skip the rest of the formula and pop a msg box up saying data already there..
2 problems I cant for the life of me work out how to integrate the match into the current formula
I have
col = 22
lastrow =11
data is currently in rows 5 to 11 in column 22
I need to match wsSource.Range("C3").Value with data in Row 5 to 11 on column 22 and if it matches then skip the rest of the formula that would paste it at the end.
the skip part of the code im trying is
VBA Code:
If Application.WorksheetFunction.Match(wsSource.Range("C3").Value, WsDest.range('''''''somehow add the correct row and column here'''''''' ,0) = True Then GoTo Skip
and 2. how do I go to a skip point without it being run if its not skipped. As I put it at the bottom of the macro but if it doesnt skip (as I havent finished skip yet) it still ends up reading out my msgbox