Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default If cell is changed clear all cells to the right in that row

I need to be able to automatic clear all cells to the right of the cell that
was changed. If anyone can help Thanks in advance.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 903
Default If cell is changed clear all cells to the right in that row

Try recording a macro then convert that to a
Change Event macro.
Event Macros, Worksheet Events and Workbook Events
http://www.mvps.org/dmcritchie/excel/event.htm

Here is something to play with, install
by right clicking on the sheet tab the insert following code

Option Explicit

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.row = 1 Then Exit Sub
If Target.Cells.Count 1 Then Exit Sub

On Error GoTo ErrHandler
Application.EnableEvents = False
If Target.Column 1 Then
Range(Target.Offset(0, 1), Target.Offset(0, _
Cells.SpecialCells(xlLastCell).Column _
- Target.Column)).Select

If Target.Offset(0, 1).Interior.ColorIndex = 6 Then
Selection.Interior.ColorIndex = 20
Selection.Interior.Pattern = xlSolid
Else
Selection.Interior.ColorIndex = 6
Selection.Interior.Pattern = xlSolid
End If
' Selection.Clear
End If
ErrHandler:
Application.EnableEvents = True
End Sub

---
HTH,
David McRitchie, Microsoft MVP - Excel
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

"Sonic" wrote ...
I need to be able to automatic clear all cells to the right of the cell that
was changed. If anyone can help Thanks in advance.



Reply
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
Need to clear cell values, when a different cell is changed. Nicholas Excel Discussion (Misc queries) 1 March 3rd 10 11:10 PM
Sum of cells not updating when cell changed. Lozza65 Excel Discussion (Misc queries) 3 July 21st 09 06:01 AM
Macro to clear range contents when cell contents are changed by us Steve E Excel Programming 12 February 22nd 07 09:09 PM
Delete/clear a cell based on another cells contents jademaddy Excel Programming 2 May 19th 05 06:15 PM
find a cell, jump to next roll and clear all cells jigsaw2[_3_] Excel Programming 1 September 8th 03 05:51 PM


All times are GMT +1. The time now is 05:13 PM.

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

About Us

"It's about Microsoft Excel"