LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default Creating Loops

Hi David
try the following macro. It tests column A and inserts a blank row if
the values change
Sub insert_rows()
Dim lastrow As Long
Dim row_index As Long

lastrow = ActiveSheet.Cells(Rows.count, "A").End(xlUp).row
For row_index = lastrow - 1 To 1 Step -1
If Cells(row_index, "A").Value < Cells(row_index + 1, "A").Value
Then
Cells(row_index + 1, "A").resize(10,1).EntireRow.Insert
(xlShiftDown)
End If
Next
End Sub



--
Regards
Frank Kabel
Frankfurt, Germany


David wrote:
I have a list of 40 names, and I need to insert 10 rows in between
each of them and then copy a formula from c2..ac10 and then move down
to the name and do it again.


 
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
Loops SaraJane Excel Discussion (Misc queries) 11 May 26th 07 04:47 AM
Loops... Willabo Excel Discussion (Misc queries) 2 June 14th 06 04:08 PM
Using For - Next Loops in VB Biomed New Users to Excel 4 March 22nd 05 07:12 PM
Using For - Next Loops in VB Biomed New Users to Excel 1 March 21st 05 09:35 PM
help with loops Rick B[_6_] Excel Programming 8 January 28th 04 12:32 AM


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