Thread: Help Needed...
View Single Post
  #10   Report Post  
Posted to microsoft.public.excel.programming
Rollin_Again[_20_] Rollin_Again[_20_] is offline
external usenet poster
 
Posts: 1
Default Help Needed...

The code is not very pretty but it works. I'm sure there is a bette
way to do this but after 4 glasses of red wine I'm not concerned abou
how the code looks ;)


Code
-------------------
*
Public Sub AddRows()

a = 1
b = 0

vrow = ActiveCell.Row

Do While ActiveCell.Row <= Range("A65536").End(xlUp).Row

Do While b < 7

Rows(vrow + 1 & ":" & vrow + 3).insert Shift:=xlDown
ActiveCell.Offset(a, b).Value = "Actual"
ActiveCell.Offset(a + 1, b).Value = "Forecast"
ActiveCell.Offset(a + 2, b).Value = "Variance"

vrow = vrow + 3
a = a + 3
b = b + 1

Loop

vrow = vrow + 2
Rows(vrow - 1).insert Shift:=xlDown
Range("A" & vrow).Select

a = 1
b = 0

Loop

End Sub
-------------------







Rolli

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