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?
 

Some videos you may like

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.

ravishankar

Well-known Member
Joined
Feb 23, 2006
Messages
3,566
Hi
range("A4:A5").clearcontents
range('A4:A5").interior.colorindex = x1None
Change the range to suit your number in the dropdown
RAvi
 

silverskye787

Board Regular
Joined
Jun 18, 2007
Messages
109
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
 

ravishankar

Well-known Member
Joined
Feb 23, 2006
Messages
3,566
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
 

Watch MrExcel Video

Forum statistics

Threads
1,122,333
Messages
5,595,560
Members
413,996
Latest member
mabelO

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
Top