I have the attached VBA code that is a macro that copies data from five sheets that each have an individual data connection to a SharePoint site into a sixth sheet called ROLLUP. For some reason, when the macro runs, it creates a new data connection and calls it American1 (the first sheet name with a 1 after it) and this new connection posts data into the Rollup sheet. The problem is that every time you run the macro, it leaves the copy and then makes another copy of this new data connection. So when you run the macro a second time, there is now an American, American1, and American2 data connection. The American connection is approrpiate as it is the connection for the American tab, but the American1 tab is no longer being used and now the American2 connection is pasting to the Rollup sheet. Am I missing something in my code?
Macro Text.txt
Bookmarks