Sheet1.Cells.ClearContents Not Clearing Everything

ransomedbyfire

Board Regular
Joined
Mar 9, 2011
Messages
121
I have been using Sheet1.Cells.Clearcontents to clear a sheet; but I've noticed that when I do an SQL query via VBA and use this code, it doesn't always clear all cells. So then, when I try to replace the old imported table with a new one, I get a message about not overlapping tables.

Can someone give me a better way to make sure ALL cells in a sheet are cleared?

Thanks!
 

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest
AlphaFrog, thanks for the reply; but I'm thinking that the issue is mainly with what Excel considers "Cells" to be. Is there another way to tell Excel to do something to every cell in a sheet?
 
Upvote 0

Forum statistics

Threads
1,224,602
Messages
6,179,841
Members
452,948
Latest member
UsmanAli786

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