View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Darwin[_2_] Darwin[_2_] is offline
external usenet poster
 
Posts: 5
Default Insert a calculated number of blank rows

Patrick

I get an application defined or object defined error with this Macro.

"Patrick Molloy" wrote:

sorry, should be column J of course

Dim rw As Long
For rw = Range("J2").End(xlDown).Row To 1 Step -1
Rows(rw).Offset(1).Resize(Cells(rw, "J")).Insert
Next

"Patrick Molloy" wrote:

Dim rw As Long
For rw = Range("I2").End(xlDown).Row To 1 Step -1
Rows(rw).Offset(1).Resize(Cells(rw, "I")).Insert
Next






"Darwin" wrote:

I have a range of years in 2 columns. The beginning year is in column H and
the end year is in column I. In column J I have the results of subtracting
Column H from Column I. I need to insert the same number of rows as this
result after each entry. I would appreciate any help as this is a fairly long
spreadsheet and it would be very time consuming to do it manually.

Thanks
Darwin