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

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
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,218,575
Messages
6,143,313
Members
450,477
Latest member
teresab543

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