Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / September 2007

Tip: Looking for answers? Try searching our database.

FInd value and insert rows below

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
vlad - 20 Sep 2007 11:08 GMT
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
Mike H - 20 Sep 2007 11:22 GMT
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

> 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
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.