deleteing contents of one cell based on contents of another


Posted by Mark C. on February 25, 2001 1:52 PM

please help!!

what i need to do is :
if contents of cell a1 = "y" then delete contents of cell d1

can this be done with a formula or does it require a macro?

Posted by Aladin Akyurek on February 25, 2001 2:25 PM

Hard to interpret what you mean. How does D1 gets its "contents" that must be "deleted" when A1="y"? By a formula or what?

Aladin

D1

Posted by David Hawley on February 25, 2001 3:55 PM

Hi Mark

Most definately a macro.

Right click on your sheet name tab, select "View Code" and paste in this code.

Private Sub Worksheet_Change(ByVal Target As Range)
If Range("A1") = "y" Then Range("D1").ClearContents
End Sub


Push Alt+Q. Save

Dave

OzGrid Business Applications

Posted by Aladin Akyurek on February 25, 2001 10:00 PM

can this be done with a formula or does it require a macro?

Dave: Aren't you worried about wiping out what already is in D1? What happens if A1 changes from "y" to something else?

Aladin



Posted by David Hawley on February 26, 2001 2:56 AM


Aladin
>Aren't you worried about wiping out what already is in D1?

I thought that was what Mark wanted to do!

>What happens if A1 changes from "y" to something else?

Nothing!

Dave


OzGrid Business Applications