#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 7
Default Insert new rows

I posted this earlier, but it didn't appear (my apologies if this is the
second time).

My table looks like this:

A B C D E
F G
1 Organisation Adress Contact Org. type Linkage Outcome
2 Employer
3 Industry
4 Schools
5 Referral
6 Employment
7 Groups
8 Training
9 Community
10 Media
11 Other

Each of the "A" culumn is a heading category with one row each. I wanted to
be able to generate a new row when data is entered into each category (eg
when new data is added to B2 a new line will automatically appear at 3 to
allow room for new data for the employer category). A new line would insert
for each of the column A categories in the same way.

Thankyou for your time and help with this, much appreciated.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,520
Default Insert new rows

You need to use a VBA solution to do this. Select the sheet tab which you
want to work with. Right click the sheet tab and click on 'View Code'. This
will launch VBE. Paste the below code to the right blank portion. Get back to
to workbook and try out.

Private Sub Worksheet_Change(ByVal Target As Range)
If Not Application.Intersect(Target, Range("A1:G20")) Is Nothing Then
If Target < "" Then
Application.EnableEvents = False
If Range("A" & Target.Row + 1) < "" Then Rows(Target.Row + 1).Insert
Application.EnableEvents = True
End If
End If
End Sub

If this post helps click Yes
---------------
Jacob Skaria


"Fellow" wrote:

I posted this earlier, but it didn't appear (my apologies if this is the
second time).

My table looks like this:

A B C D E
F G
1 Organisation Adress Contact Org. type Linkage Outcome
2 Employer
3 Industry
4 Schools
5 Referral
6 Employment
7 Groups
8 Training
9 Community
10 Media
11 Other

Each of the "A" culumn is a heading category with one row each. I wanted to
be able to generate a new row when data is entered into each category (eg
when new data is added to B2 a new line will automatically appear at 3 to
allow room for new data for the employer category). A new line would insert
for each of the column A categories in the same way.

Thankyou for your time and help with this, much appreciated.

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 7
Default Insert new rows

Thanks Jacob - perfect!
Is there anyway for the blank boxes to contain the word (new)?
Cheers,
Fellow

"Jacob Skaria" wrote:

You need to use a VBA solution to do this. Select the sheet tab which you
want to work with. Right click the sheet tab and click on 'View Code'. This
will launch VBE. Paste the below code to the right blank portion. Get back to
to workbook and try out.

Private Sub Worksheet_Change(ByVal Target As Range)
If Not Application.Intersect(Target, Range("A1:G20")) Is Nothing Then
If Target < "" Then
Application.EnableEvents = False
If Range("A" & Target.Row + 1) < "" Then Rows(Target.Row + 1).Insert
Application.EnableEvents = True
End If
End If
End Sub

If this post helps click Yes
---------------
Jacob Skaria


"Fellow" wrote:

I posted this earlier, but it didn't appear (my apologies if this is the
second time).

My table looks like this:

A B C D E
F G
1 Organisation Adress Contact Org. type Linkage Outcome
2 Employer
3 Industry
4 Schools
5 Referral
6 Employment
7 Groups
8 Training
9 Community
10 Media
11 Other

Each of the "A" culumn is a heading category with one row each. I wanted to
be able to generate a new row when data is entered into each category (eg
when new data is added to B2 a new line will automatically appear at 3 to
allow room for new data for the employer category). A new line would insert
for each of the column A categories in the same way.

Thankyou for your time and help with this, much appreciated.

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
insert rows in a worksheet that do not change adjoining rows craigandmel Excel Discussion (Misc queries) 2 April 29th 08 10:26 PM
How do i insert blank rows between data that is thousands of rows paul.eatwell Excel Discussion (Misc queries) 5 April 14th 08 10:49 PM
Insert rows: Formats & formulas extended to additonal rows Twishlist Excel Worksheet Functions 0 October 22nd 07 04:23 AM
How do I insert blank rows between rows in completed worksheet? bblue1978 Excel Discussion (Misc queries) 1 October 26th 06 07:02 PM
How do i insert of spacer rows between rows in large spreadsheets laurel Excel Discussion (Misc queries) 0 April 24th 06 01:38 PM


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