So:
or
1. the fastest search method in VBA I am familiar with is Instr.
2. so I put all the existing ID's in column2 into 1 textstring (c01), each ID separated by a pipeline |
3. I open the 'notepad' file, split all the rows and filter only those lines that contain a colon (only lines with a colon contain an ID in your notepad example): the result is a 1 dimensional array sn
4. Now we check each line from the notepad file (= each element in the array sn) to the string that contains all existing ID's., using Instr.
- To get the ID from each array-item we split each array-item by the tabdelimiter and take the first item from the splitting result. The first item is item 0.
- we look whether the string c01 contains that item; if not
* mark that item replacing it's value by "~~", so we can filter all "~~" items afterwards
or (method snb_2)
* filter the array sn by the not found ID, removing all items from sn that contain the not-found ID
- method 1: remove from array sn all items that contain "~~")
5. write the resulting array sn into sheet2
Bookmarks