VBA Deleting Columns based on cell shading

mackius

New Member
Joined
Jun 10, 2013
Messages
4
Hi All,

The worksheets I have, require deleting all columns shaded green on row 13. Up to and including column 150.

I have a spreadsheet with headers on row 13, and a few thousand rows of data thereafter. Variable number of columns, starting from 100 to several hundred depending.

My problem is that there are randomly dispersed columns in the data set that need to be deleted (always within first 150 columns).

The only way of identifying these unwanted rows is that said rows are all green in <gs id="932719e4-cb9b-40d0-aa02-5d3c59c1db58" ginger_software_uiphraseguid="5bbc3a81-ed6f-480e-a209-ba4181f2b410" class="GINGER_SOFTWARE_mark">colour</gs> (The lighter shade of green in the 10 standard <gs id="121250da-4053-4608-923f-4cfe7aecf493" ginger_software_uiphraseguid="5bbc3a81-ed6f-480e-a209-ba4181f2b410" class="GINGER_SOFTWARE_mark">colours</gs>), starting from the header, down to the last row of data.

PRO LEVEL - for if you really want to show off your skills and impress a random stranger out there on the interwebs (me):
There are multiple worksheets in the workbook which this could be applied to at the same time. Happy to assume sheet1, sheet2, sheet3 etc. (Up to 10 specific sheets simultaneously, <gs id="149dca67-73ac-4bc0-b535-e4c9e7b4979e" ginger_software_uiphraseguid="c4bb4501-9eb8-4c90-8c0f-0741397c964e" class="GINGER_SOFTWARE_mark">however there</gs> are a few sheets in the workbook this should not be applied to.... eg sheetX, sheetY, sheetZ

Happy to provide any extra clarification if required,

Cheers,

<gs id="020b5972-3da6-4e59-8535-047f5c2b8da3" ginger_software_uiphraseguid="7214633b-815a-4470-8e4b-e1926b1d0e82" class="GINGER_SOFTWARE_mark">Mackius</gs>
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
"The only way of identifying these unwanted columns is that said columns are all green in <gs id="932719e4-cb9b-40d0-aa02-5d3c59c1db58" ginger_software_uiphraseguid="5bbc3a81-ed6f-480e-a209-ba4181f2b410" class="GINGER_SOFTWARE_mark" style="color: rgb(51, 51, 51); background-color: rgb(250, 250, 250);">colour"
NOT
"The only way of identifying these unwanted rows is that said rows are all green in <gs id="932719e4-cb9b-40d0-aa02-5d3c59c1db58" ginger_software_uiphraseguid="5bbc3a81-ed6f-480e-a209-ba4181f2b410" class="GINGER_SOFTWARE_mark">colour"</gs></gs>
 
Upvote 0

Forum statistics

Threads
1,215,059
Messages
6,122,913
Members
449,093
Latest member
dbomb1414

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