View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
kkknie[_21_] kkknie[_21_] is offline
external usenet poster
 
Posts: 1
Default Inserting rows based on another cells value

A quick macro:

Code
-------------------
Sub test()

Dim i As Long

For i = 2 To 1000
If Cells(i - 1, 1).Value = 2 Then Cells(i, 1).EntireRow.Insert shift:=xlDown
If Cells(i - 1, 1).Value = 3 Then
Cells(i, 1).EntireRow.Insert shift:=xlDown
Cells(i, 1).EntireRow.Insert shift:=xlDown
End If
Next

End Su
-------------------

Change the 1000 to the number of rows you have and change the one afte
the comma in cells(i-1, 1) and cells(i,1) to the column number.



--
Message posted from http://www.ExcelForum.com