Darren DICK
darrend at nimble.com.au
Tue Apr 4 00:12:37 CDT 2006
Hi all Cross Posted to dbqSQL list I am outputting reports to Excel from reporting services (SQL) The reports have many tables on them with differing column widths When I output the reports to Excel I find many columns with no data in them Is there a way I can write some VBA and have it determine the last row on the sheet with a value in it determine if there is any data in any cell from the top to the bottom - if there is no data in the column delete it. Then 'tighten' all the columns? E.G. Column A has data, column B not data, column c has data Delete column b and move column C to the left E.G. AirCode For my sheet find last.row with data ' that becomes the base point find last.column with data ' that becomes a base point loop through columns & rows for A to last column from 1 to last row if data = null then delete column currentcolumn blah blah blah Many thanks in advance Darren