Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 169
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,236
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 169
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,236
Default 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
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
Automatically inserting a symbol when text is entered in the cell Frustratedfemale26 Excel Discussion (Misc queries) 1 August 28th 09 11:25 AM
Value must be entered JStiehl Excel Discussion (Misc queries) 1 May 16th 08 02:10 PM
Inserting current date when number entered in cell & Circular reference error? Pheasant Plucker® Excel Discussion (Misc queries) 4 April 10th 07 10:39 AM
No value entered WannaKooky Excel Worksheet Functions 2 November 1st 04 03:51 PM
How to get last entered value in a ROW? Excelwiz wanabee Excel Programming 13 December 3rd 03 11:05 PM


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