I am posting this same question that I put on another forum but haven't received an answer from the other yet. Here is the link for reference http://www.ozgrid.com/forum/showthre...295#post575295

I am attempting to copy and insert the entire row only if the value of that row in column k is greater than zero. If it is i need to have that many rows copied and inserted then that value in k to be 1. then it needs to continue until all rows have been checked and the column K value for each = 1. There are over 15000 lines of data.

I'm newer to using VBA and could really use some help here. I attached a sample of the table and some of the code I started on. I had it working so it would copy the rows then paste the desired amount but could never figure out how to get it to check and repeat for all lines then return value of 1 in column K.

A B C D E F G H I J K L M N O
1 LFW LDA name 10/5/2010 BIC 898 1 48 40 40 1 1.001 16:54:29 1 124961760-1
2 LFW LDA name 10/5/2010 BIC 898 1 48 40 40 1 1.001 16:54:29 1 124961760-2
3 LFW LDA name 10/5/2010 BIC 898 1 48 40 40 3 1.001 16:54:29 1 124961760-3
4 LFW LDA name 10/5/2010 BIC 898 1 48 40 40 5 1.001 16:54:29 1 124961760-4

Sub CopyRowInsert()
If ThisWorkbook.Sheets("DATA").ActiveCell.Value > 1 Then
Do
Rows("2:2").Select
Range("K2").Activate
Selection.Copy
Selection.Insert Shift:=xlUp
Dim x As Integer
x = ActiveCell.Value
x = x - 1
ActiveCell.Value = x
Loop Until x = 1

End If
End Sub