Clear Sheet except first 3 columns

Ploom

New Member
Joined
Feb 28, 2016
Messages
28
Hi!
I would like to clear the contents of my sheets except the first 3 columns
I tried
Sub cal_return()
Sheets("Stock Data").Select
Columns("3:" & Columns.Count).ClearContents

However it returns me Error 1004, I don't understand
Btw i'm using Office 2013

Do you have any suggestions
Thanks!
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
Not sure why yours doesn't work, but this works for me

Cells(1, 1).Offset(0, 3).Resize(1, Columns.Count - 3).EntireColumn.ClearContents

It should also function on older versions.

I hope this helps.

Ken
 
Upvote 0

Forum statistics

Threads
1,214,429
Messages
6,119,433
Members
448,897
Latest member
ksjohnson1970

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