Can somebody help me figure out the code below? I'm trying to insert rows as part of a macro. I have the code inserting lines working, but I need it only to insert lines where the value in column B is greater than 1000.
Currently, the code is producing this:
Finally, I need the value in column B of each inserted row to match the value of the cell being evaluated as part of the loop.
Thank you in advanve for any help!
VBA Code:
Dim ws As Worksheet
Dim rowsn As Integer, count2 As Integer
Dim line As Range
Dim partners As Integer
Set ws = ActiveWorkbook.Sheets("UNIT_PRICE_COMP")
ws.Activate
Dim i As Long
partners = Worksheets("Settings").Range("C13").Value
For i = Range("B" & Rows.count).End(xlUp).Row To 8 Step -1
'If Cells(count, 2).Value > 1000 Then
Rows(i).Resize(partners - 1).Insert
'End If
Next i
Currently, the code is producing this:
Finally, I need the value in column B of each inserted row to match the value of the cell being evaluated as part of the loop.
Thank you in advanve for any help!