View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
richardreye[_3_] richardreye[_3_] is offline
external usenet poster
 
Posts: 1
Default Inserting row based on value in cell in Column C

Not sure if the IsNumeric actually helps that much but
here is some code that will work

Sub InsertRows()

For Each cell In Range("C:C")
If IsNumeric(cell.Value) And cell.Value = 1 Then
Range(cell.Offset(1, 0).EntireRow, _
cell.Offset(cell.Value, 0).EntireRow).Insert
xlDown
End If
Next cell

End Sub

Cheers

-----Original Message-----
Hi,

I need a macro that will take values in column C and add

that number of rows
below that cell as the number in that cell.

An example:
A cell in C2 for instance has the value 3. I want the

macro to then read the
3 in cell C2 and then add 3 rows below cell C2 or row 2.

Please help. This is like a two step process that I need

help with. Thank
you.

Anonymous Chief


.