This is what your code is saying, which will help identify the issue:
Build an empty NoServer table
Read existing Server Names from Sheet1 to dt variable
For each item, If input Server is not in dt variable, then Add it to the NoServer table
Write Range the NoServer table to Sheet2
So I see 2 problems:
—You are reading from Sheet1 but then writing to Sheet2, so the Server file doesn’t get updated from Sheet1.
—After you add a Server to the noServer table, you are still checking the Server list from Sheet1 that is stored in the dt variable.
To solve this, I would recommend that you think about the noServer list as the existing Servers that you want to update to from the Excel file, and that is the list that you check if the Server is already found. (you only need to build an empty noServer table if the Excel file does not exist.
To clarify, let me provide you some sample snips of the edits.
The above shows that you can check if File exists, if it does not then Build the table. As shown, I put the noServer variable in the Read Range. —Then, you can use that variable in the .Select instead
Adjusted .Select to look in noServer which is the updated Server table.
And shown there, that you can use Sheet1 to overwrite the Server table with the updated one.
I hope this helps you.