LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 48
Default insert rows

This should help you
--------------------------------------------------------------------------
Sub insert2rows()
Dim cel As Range
Range("A65536").End(xlUp).Select
Do While Selection.Address < "$A$2"
If Selection.Value < "" And Selection.Offset(-1, 0).Value = "" Then
Selection.EntireRow.Insert
Selection.EntireRow.Insert
End If
Selection.Offset(-1, 0).Select
Loop
End Sub
--------------------------------------------------------------------------

There can be better ways of doing this, but this is the first thing i
thought after seeing your mail.

HTH

~Yogendra

boogie wrote:
Ok, A1 is empty and B:1:G1 is filled with data. A2:G2 is
filled with data. In plain English, this is what I want to
do. If the cell on top of the cell that is filled with
data is empty, it will insert 2 rows on top. I just have
several data that I need to insert rows inbetween
particular item.
A B C D E
1 M012 Martin Computer 90
2 Math 75
3 History 65
4 Science 100
6 E013 Earn Go Computer 100
7 Math 93
8 History 70
9 Science 85


I want to insert 2 rows in between 4 and 6 automatically..
thanks


 
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 02:11 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"