Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Inserting/Deleting Rows when values are added /cleared
Hi, I have the following code, I need to tweak it so that only if i insert a
value into "A" column a line is inserted below, currently if i insert values into any other col a line is inserted, also if i delete/clear the value that Ive just added the line that has been inserted will be deleted Help is much appreciated Private Sub Worksheet_Change(ByVal Target As Range) If Target.Cells.Count = 1 Then Target.Offset(1).EntireRow.Insert xlShiftDown End If End Sub |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Inserting/Deleting Rows when values are added /cleared
Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False On Error Goto ws_exit: With Target If .Column = 1 Then If .Cells.Count = 1 Then .Offset(1).EntireRow.Insert xlShiftDown End If End If End With ws_exit: Application.EnableEvents = True End Sub -- HTH Bob Phillips "teresa" wrote in message ... Hi, I have the following code, I need to tweak it so that only if i insert a value into "A" column a line is inserted below, currently if i insert values into any other col a line is inserted, also if i delete/clear the value that Ive just added the line that has been inserted will be deleted Help is much appreciated Private Sub Worksheet_Change(ByVal Target As Range) If Target.Cells.Count = 1 Then Target.Offset(1).EntireRow.Insert xlShiftDown End If End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Inserting and Deleting Rows in Excel | Excel Worksheet Functions | |||
CF goes crazy when deleting/inserting rows | Excel Discussion (Misc queries) | |||
Speed of Excel When Inserting & Deleting Rows | Excel Discussion (Misc queries) | |||
Inserting/deleting rows between worksheets | Excel Worksheet Functions | |||
inserting deleting rows?how do i get the other sheets to do the sa | Excel Discussion (Misc queries) |