View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 6,953
Default VB Add a blank row?

assume the word Total in is column F

Sub Addrows()
Dim lastrow as Long, i as Long
lastrow = cells(rows.count,"F").end(xlup).row
for i = lastrow to 2 step -1
if instr(1,cells(i,"F"),"Total",vbTextCompare) then
rows(i).Insert
end if
Next
End sub


--
Regards,
Tom Ogilvy

"Sandy" wrote:

Is there an easy way to add a blank row after each sub-total in a spreadsheet
using VB?

Thanks,

Sandy