Help!

LoopyD

New Member
Joined
Dec 12, 2023
Messages
3
Office Version
  1. 365
Platform
  1. Windows
Some plonker has been in my excel spreadsheet for auditing and whatever they have done there’s no 16000+ columns in the table I created! 🤦🏼‍♀️ 🤦🏼‍♀️

Is there a way I can set the number of columns back to the number I need without having to go through and delete them??

I would leave it as it is, but I can’t because I need to delete some no longer needed rows and it won’t as it’s too much data with that many columns 🤦🏼‍♀️ 🤦🏼‍♀️

Any help much appreciated!!!!
 

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney
Are the added/unwanted column all to the right of the ones you want to keep?
If so, just select the first column to delete by clicking on the header (that is the letter/s that defines the column), once selected hold Ctrl+Shift and press Right. Now all the unwanted columns will be selected. And delete them.
 
Upvote 0
Are the added/unwanted column all to the right of the ones you want to keep?
If so, just select the first column to delete by clicking on the header (that is the letter/s that defines the column), once selected hold Ctrl+Shift and press Right. Now all the unwanted columns will be selected. And delete them.
Hi,
Thanks for your reply.
Tried that it won’t do it, comes up with an area as it’s too much for it to process in one go? 🤔
 
Upvote 0
Re "columns in the table I created!"
Try on a COPY of your workbook first.
Code:
Dim tbl As ListObject
Dim x As Long
Set tbl = ActiveSheet.ListObjects("Table1")    '<----- Change as required
  For x = tbl.ListColumns.Count To 8 Step - 1   '<----- If you want to keep 7 Columns
    tbl.ListColumns(x).Delete
  Next x
 
Upvote 0

Forum statistics

Threads
1,215,106
Messages
6,123,124
Members
449,096
Latest member
provoking

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