LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 152
Default Clear contents on change

If a cell in COL O changes, I want to clear the contents of COL P, Q R (in
the same row)
If a cell in COL Q changes, I want to clear the contents of COL O, P, R
(again in the same row)

I think I had the following working in Excel 2003, but its not working in
2007.

Private Sub Worksheet_Change(ByVal Target As Excel.Range)

With Target
Select Case .Column
Case 15 'column O
Application.EnableEvents = False
Cells(.Row, "P").ClearContents
Cells(.Row, "Q").ClearContents
Cells(.Row, "R").ClearContents
Application.EnableEvents = True
Case 17 'column Q
Application.EnableEvents = False
Cells(.Row, "O").ClearContents
Cells(.Row, "P").ClearContents
Cells(.Row, "R").ClearContents
Application.EnableEvents = True
End Select
End With

End Sub
 
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
Clear Contents Secret Squirrel Excel Discussion (Misc queries) 1 February 3rd 09 12:37 AM
clear contents Arne Hegefors Excel Programming 1 June 13th 07 03:39 PM
Macro to clear range contents when cell contents are changed by us Steve E Excel Programming 12 February 22nd 07 09:09 PM
Clear contents Arne Hegefors Excel Programming 3 September 28th 06 05:43 PM
Clear Contents Help michael Excel Programming 3 June 6th 06 09:42 PM


All times are GMT +1. The time now is 11:55 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"