easy formula help

silverskye787

Board Regular
Joined
Jun 18, 2007
Messages
109
4443cu8.jpg


I have a drop-down box on A2 and it has a range of numbers from 1-6

if i select 2 in the drop-down box, it will hightlight the box in yellow.

but there's one problem and that is previously i select 3 and type a date on A5 but now i select 2 and cell A5 doesnt clear the content in it.

that means i need to clear those that is not highlighted in yellow.
i have set the box to be highlighted in yellow according to the drop-down box number.

can i know how to clear the content inside the cell which is not highlighted in yellow?
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
Hi
range("A4:A5").clearcontents
range('A4:A5").interior.colorindex = x1None
Change the range to suit your number in the dropdown
RAvi
 
Upvote 0
thanks alot.. but i only want to delete those contents that are not highlighted in yellow but keep those that are highlighted in yellow..

as in not clear the whole content
 
Upvote 0
HI
clear cotent works on the range you specify. I have given a hypothetical example fo A4:A5. You should modify it to suit your needs (where yellow is /is not there)
ravi
 
Upvote 0

Forum statistics

Threads
1,214,907
Messages
6,122,181
Members
449,071
Latest member
cdnMech

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