Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Inserting a row when a value is entered
I need code for the following:
If I enter a value in a2 , a row is inserted below Thanks for any assistance |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Inserting a row when a value is entered
Use this sheet event code:
Private Sub Worksheet_Change(ByVal Target As Range) If Target.Cells.Count = 1 Then Target.Offset(1).EntireRow.Insert xlShiftDown End If End Sub -- Rob van Gelder - http://www.vangelder.co.nz/excel "teresa" wrote in message ... I need code for the following: If I enter a value in a2 , a row is inserted below Thanks for any assistance |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Inserting a row when a value is entered
You haven't tested A2 Rob.
Private Sub Worksheet_Change(ByVal Target As Range) With Target If .Address = "$A$2" Then .Offset(1).EntireRow.Insert xlShiftDown End If End With End Sub -- HTH RP (remove nothere from the email address if mailing direct) "Rob van Gelder" wrote in message ... Use this sheet event code: Private Sub Worksheet_Change(ByVal Target As Range) If Target.Cells.Count = 1 Then Target.Offset(1).EntireRow.Insert xlShiftDown End If End Sub -- Rob van Gelder - http://www.vangelder.co.nz/excel "teresa" wrote in message ... I need code for the following: If I enter a value in a2 , a row is inserted below Thanks for any assistance |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Inserting a row when a value is entered
Thanks Bob - very helpful
"Bob Phillips" wrote: You haven't tested A2 Rob. Private Sub Worksheet_Change(ByVal Target As Range) With Target If .Address = "$A$2" Then .Offset(1).EntireRow.Insert xlShiftDown End If End With End Sub -- HTH RP (remove nothere from the email address if mailing direct) "Rob van Gelder" wrote in message ... Use this sheet event code: Private Sub Worksheet_Change(ByVal Target As Range) If Target.Cells.Count = 1 Then Target.Offset(1).EntireRow.Insert xlShiftDown End If End Sub -- Rob van Gelder - http://www.vangelder.co.nz/excel "teresa" wrote in message ... I need code for the following: If I enter a value in a2 , a row is inserted below Thanks for any assistance |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Inserting a row when a value is entered
I assumed A2 was for example - you're right... Thanks.
-- Rob van Gelder - http://www.vangelder.co.nz/excel "Bob Phillips" wrote in message ... You haven't tested A2 Rob. Private Sub Worksheet_Change(ByVal Target As Range) With Target If .Address = "$A$2" Then .Offset(1).EntireRow.Insert xlShiftDown End If End With End Sub -- HTH RP (remove nothere from the email address if mailing direct) "Rob van Gelder" wrote in message ... Use this sheet event code: Private Sub Worksheet_Change(ByVal Target As Range) If Target.Cells.Count = 1 Then Target.Offset(1).EntireRow.Insert xlShiftDown End If End Sub -- Rob van Gelder - http://www.vangelder.co.nz/excel "teresa" wrote in message ... I need code for the following: If I enter a value in a2 , a row is inserted below Thanks for any assistance |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Automatically inserting a symbol when text is entered in the cell | Excel Discussion (Misc queries) | |||
Value must be entered | Excel Discussion (Misc queries) | |||
Inserting current date when number entered in cell & Circular reference error? | Excel Discussion (Misc queries) | |||
No value entered | Excel Worksheet Functions | |||
How to get last entered value in a ROW? | Excel Programming |