Macro to Delete Columns

Kim B

Board Regular
Joined
Jun 16, 2008
Messages
233
Office Version
  1. 365
Hi All. I am looking for a simple macro auto fit columns and delete columns N,P,Q,R,T so leaving O,Q,S,U

It will always be those columns to delete but the trick is the data is pulled down daily so if it possible to have the macro run on each new workbook as it is pulled down

I have tried using record macro but there seems to be no option in store macro in drop down that will work with a new workbook. if I select new workbook, it's not there unless I am doing something wrong when setting up the record macro.. I was usin shortcut key r

As always thank you in advance

1714569754598.png
 
ok, as you suggested, I have posted a separate request with both requests (delete, resize) and extract to separate workbooks.

Sorry for the confusion. Thank you in advance if you happen to pick it up again. I will also mark the post that has the solution to the resize/delete request.
 
Upvote 0

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
This is what I was searching for to delete columns. One questions is why does this code create a new workbook? I have a button set up to use this code.
 
Upvote 0

Forum statistics

Threads
1,223,893
Messages
6,175,244
Members
452,622
Latest member
Laura_PinksBTHFT

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