Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Need to clear cell values, when a different cell is changed. | Excel Discussion (Misc queries) | |||
Sum of cells not updating when cell changed. | Excel Discussion (Misc queries) | |||
Macro to clear range contents when cell contents are changed by us | Excel Programming | |||
Delete/clear a cell based on another cells contents | Excel Programming | |||
find a cell, jump to next roll and clear all cells | Excel Programming |