View Single Post
  #1   Report Post  
Martin P
 
Posts: n/a
Default

I believe this worksheet method will also take much less time than doing the
insertion by hand. The rows are inserted before the 5. If you need them after
the 5 a slight modification should not be too difficult.
I have assumed your values are in column B.
Cell A1: =ROW($B1)+D1
Cell C1: =IF(B1=5,2,0)
Cell D1: =SUM($C$1:C1)
Cell F1: =ROW(B1)-ROW($B$1)+1
Cell G1: =VLOOKUP(F1,$A$1:$B$35,2,FALSE)
Copy C1 to G1 as far down as necessary and also copy A1 down as far as
necessary.
Copy what you have in column G and use Edit, Paste Special to paste values
to a different worksheet. Use Edit, Replace to replace #N/A with nothing.
"Dr. Picou" wrote:

Have a long column of numbers
Every time I see the number 5, I need to insert two rows. Doing this by
hand is tedious. Can you help me find a shortcut?
The IF function does not do this, right?