tiredofit
Well-known Member
- Joined
- Apr 11, 2013
- Messages
- 1,924
- Office Version
- 365
- 2019
- Platform
- Windows
My worksheet contains query which I can easily refresh by right-clicking and choosing refresh.
However, I want to remove the values on the worksheet without removing the query.
If I did that manually, a message pops up asking if I want to remove the query as well, so that if I choose no, the values on the worksheet are removed but I can still right-click to refresh my query.
How can I remove the data on the worksheet using code, yet still preserve the query?
I recorded a macro (and the message box popped up) and it showed this:
but running the code ,no message box popped up and it removed the query.
Thanks
However, I want to remove the values on the worksheet without removing the query.
If I did that manually, a message pops up asking if I want to remove the query as well, so that if I choose no, the values on the worksheet are removed but I can still right-click to refresh my query.
How can I remove the data on the worksheet using code, yet still preserve the query?
I recorded a macro (and the message box popped up) and it showed this:
Code:
Cell.Select
Selction.ClearContents
but running the code ,no message box popped up and it removed the query.
Thanks
Last edited: