Deleting Columns in spreadsheet if column has not been edited.

goblue667

New Member
Joined
Aug 12, 2019
Messages
11
Hi I have a somewhat unusual question in my request here.

I have a spreadsheet where columns may be edited and if they have, I need to keep those and delete the rest. So if there were 45 rows, and only 1 of the 45 were edited, that whole column needs to be kept.

I have played around with the Review ribbon and added a Highlight Changes tool which displays a blue border around each cell that has been edited. Is there a way using VBA to delete those columns that do not have a blue border on them? Attached is a sample document of mine.
Capture.JPG
 

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.
Does the "Highlight Changes" tool simply change the cell properties to add a blue border if the cell has been altered? You could loop through each cell and look at the properties of that cell to determine if there are borders on. If you are using the actual cell properties to highlight changes though, it would make the coding easier if you used cell fill vs. borders as borders can sometimes get applied to adjacent cells too, which would cause confusion. If you can provide some more detail on your Highlight Changes tool, then I can mock up some VBA code
 
Upvote 0

Forum statistics

Threads
1,223,749
Messages
6,174,275
Members
452,553
Latest member
red83

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