Clear Contents - Data Next to Query Auto Formatting Override

bs0d

Well-known Member
Joined
Dec 29, 2006
Messages
622
I have a query in Column A. I'm adding and removing data in the columns to the right.

My problem occurs when I enter, and subsequently clearcontents in the same header row as the query in column A, excel automatically adds "column1". This would continue to "column2" and "column3" if I had data in columns B, C and so on.

The only way to get it to disappear is to delete the entire column(s). I cannot do this because it would break other references I have.

Is there a setting I need to disable or enable that prevents this auto formatting in Excel for my query?
 

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.
I think Excel is trying to outsmart the user and is expanding the named range of the query. Although I haven't figured out how to prevent it from doing this. if the values are put to the cells in VBA, it seems to bypass the auto formatting. But if you manually key in a value, it picks it up (auto filter applied).
 
Upvote 0
[SOLVED]

Converting the table (query) to a range did the trick.

Code:
With Worksheets("Sheet_Name_Here").ListObjects("Query_Name")
     .Unlist
End With
 
Upvote 0

Forum statistics

Threads
1,223,098
Messages
6,170,103
Members
452,302
Latest member
TaMere

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top