How to automatically insert a blank row after a group of data

This does exactly what you are asking, checks the rows, and inserts a blank empty row at each change in column A: sub AddBlankRows() ‘ dim iRow as integer, iCol as integer dim oRng as range set oRng=range(“a1”) irow=oRng.row icol=oRng.column do ‘ if cells(irow+1, iCol)<>cells(irow,iCol) then cells(irow+1,iCol).entirerow.insert shift:=xldown irow=irow+2 else irow=irow+1 end if ‘ loop … Read more

Add a summary row with totals

If you are on SQL Server 2008 or later version, you can use the ROLLUP() GROUP BY function: SELECT Type = ISNULL(Type, ‘Total’), TotalSales = SUM(TotalSales) FROM atable GROUP BY ROLLUP(Type) ; This assumes that the Type column cannot have NULLs and so the NULL in this query would indicate the rollup row, the one … Read more