Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default FInd value and insert rows below

I have numbers in column A from 1,2,3,4,5,..etc.
I need a macro that will find a number for example "3" and insert 4 rows
under the row that has the number "3" in column A.
Any help will be appreciated.
Thanks


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default FInd value and insert rows below

Right click sheet tab, view code and paste this in:-

Sub atomic()
For x = Range("A65536").End(xlUp).Row To 1 Step -1
If Cells(x, 1).Value = 3 Then
Cells(x + 1, 1).Select
For y = 1 To 4
Selection.EntireRow.Insert
Next
End If
Next
End Sub


Mike

"vlad" wrote:

I have numbers in column A from 1,2,3,4,5,..etc.
I need a macro that will find a number for example "3" and insert 4 rows
under the row that has the number "3" in column A.
Any help will be appreciated.
Thanks


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
Array to find rows need to insert date criteria Excel 2003 - SPB Excel Discussion (Misc queries) 5 September 1st 07 06:33 PM
Find & Replace and Find & Insert macro help needed RS Excel Programming 2 January 29th 07 07:35 AM
Want to find "2006 QTY" & insert 3 rows... tawtrey(remove this )@pacificfoods.com Excel Worksheet Functions 4 October 17th 06 06:04 PM
find number & insert rows Steve Wallis Excel Programming 4 March 21st 06 05:48 PM
Can I use "find / replace" to automatically "Insert Rows" in a do. Dr. Picou Excel Discussion (Misc queries) 2 September 1st 05 09:59 PM


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