PC Review


Reply
Thread Tools Rate Thread

Clear value if cell changes

 
 
Kashyap
Guest
Posts: n/a
 
      17th Mar 2009
Hi, I have in cell drop down validation in around 8 cells and all are inter
related..

So, when the value of C5 changes, I need the contents in F5, F7 & C7 to the
cleared.. and when value of when C8 changes, contents in F8 to the cleared..
Healp pls

All the above cell have in-cell drop down validation.
 
Reply With Quote
 
 
 
 
TWhizTom
Guest
Posts: n/a
 
      17th Mar 2009
Hope this works for you...


Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$C$5" Then
Range("F7").ClearContents
Range("F5").ClearContents
Range("F7").ClearContents
End If
End Sub
--

Tech Whiz Tom
MS Access / Excel Applications Analyst


"Kashyap" wrote:

> Hi, I have in cell drop down validation in around 8 cells and all are inter
> related..
>
> So, when the value of C5 changes, I need the contents in F5, F7 & C7 to the
> cleared.. and when value of when C8 changes, contents in F8 to the cleared..
> Healp pls
>
> All the above cell have in-cell drop down validation.

 
Reply With Quote
 
Dave Peterson
Guest
Posts: n/a
 
      17th Mar 2009
Another one:

Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
If not (intersect(target, me.range("c5") is nothing) then
me.range("f5,f7,c7").clearcontents
end if
if not (intersect(target, me.range("c8") is nothing) then
me.range("F8").clearcontents
end if
End Sub




Kashyap wrote:
>
> Hi, I have in cell drop down validation in around 8 cells and all are inter
> related..
>
> So, when the value of C5 changes, I need the contents in F5, F7 & C7 to the
> cleared.. and when value of when C8 changes, contents in F8 to the cleared..
> Healp pls
>
> All the above cell have in-cell drop down validation.


--

Dave Peterson
 
Reply With Quote
 
john
Guest
Posts: n/a
 
      17th Mar 2009
try somthing this:

Private Sub Worksheet_Change(ByVal Target As Range)

If Target.Address = "$C$5" Then

Range("F7,F5,C7").ClearContents

ElseIf Target.Address = "$C$8" Then

Range("F8").ClearContents

End If

End Sub

--
jb


"Kashyap" wrote:

> Hi, I have in cell drop down validation in around 8 cells and all are inter
> related..
>
> So, when the value of C5 changes, I need the contents in F5, F7 & C7 to the
> cleared.. and when value of when C8 changes, contents in F8 to the cleared..
> Healp pls
>
> All the above cell have in-cell drop down validation.

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
If cell value is greater than another cell value, clear contents. bawpie Microsoft Excel Programming 6 22nd Dec 2009 03:38 PM
Transfer a name from one cell to another but leave clear if clear? Scoober Microsoft Excel Worksheet Functions 2 22nd May 2009 02:55 AM
Clear Cell Contents based on Criteria of another cell CK Microsoft Excel Programming 10 21st May 2009 04:07 PM
Macro to Clear Cell Contents based on Cell Value in another Sheet CH Microsoft Excel Discussion 4 26th Jan 2007 08:37 PM
Type into one cell and automatically clear contents in another cell Bo Microsoft Excel Programming 4 29th Sep 2003 06:04 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:39 PM.