LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
ck ck is offline
external usenet poster
 
Posts: 52
Default Clear Cell Contents based on Criteria of another cell

Hi,
Column B will have the criteria (y or n). If n is entered, the data in the
two cells adjacent and to the right of the current cell must have the
contents cleared. I can accomplish this for one row in Column B but I need
to have this occur for the other rows. This is what I have so far..

Private Sub Worksheet_Change(ByVal Target As Range)

Dim rng1 As Range
Dim rng2 As Range

Set rng1 = Range("b2")
Set rng2 = Range("c2:d2")

If LCase(rng1.Value) = "n" Then
rng2.clearcontents

End If
End Sub

Any help is appreciated. This is my first shot at VBA.

--
CK
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Display contents of cell based on criteria Carlee Excel Worksheet Functions 2 October 12th 07 02:28 PM
Replacing Path/filename and criteria in MS Query based on cell contents using VBA [email protected] Excel Programming 4 March 21st 07 07:47 PM
Finding cell contents based on certain criteria thekovinc Excel Discussion (Misc queries) 1 March 15th 06 07:37 PM
Finding cell contents based on certain criteria thekovinc Excel Discussion (Misc queries) 1 March 15th 06 07:20 PM
Delete/clear a cell based on another cells contents jademaddy Excel Programming 2 May 19th 05 06:15 PM


All times are GMT +1. The time now is 04:44 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"