TedX
Board Regular
- Joined
- Apr 18, 2021
- Messages
- 122
- Office Version
- 365
- Platform
- Windows
Hello
I have this one line of code that removes one query at a time from the Queries & Connections area, I spent the afternoon trying to place it in a loop so that it would run multiple times because I normally have about 10 queries in a daily session and I don't want to sit there clicking a macro 10 times. Who knows how to do this?
I have this one line of code that removes one query at a time from the Queries & Connections area, I spent the afternoon trying to place it in a loop so that it would run multiple times because I normally have about 10 queries in a daily session and I don't want to sit there clicking a macro 10 times. Who knows how to do this?
VBA Code:
Sub DeleteActiveQueries()
ActiveWorkbook.Queries(1).Delete
End Sub