View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default adding code to shrink columns to reasonable width

Sub Cleanup()
With ActiveWorkbook
.Names("Database").Delete
Application.DisplayAlerts = False
.SaveAs .FullName, xlWorkbookNormal
Application.DisplayAlerts = True
Activesheet.columns.Autofit
End With
End Sub

--
Regards,
Tom Ogilvy


"Todd F." wrote in message
...
I would like to add somehting to this clean up macro:

Sub Cleanup()
With ActiveWorkbook
.Names("Database").Delete
Application.DisplayAlerts = False
.SaveAs .FullName, xlWorkbookNormal
Application.DisplayAlerts = True
End With
End Sub

the above macro clears out a named range and it does a save as to the
current version of excel.

is it possible to added to the tail end of this routine the task of
shrinking the column width down to the widest value in the column - for

some
reason the columns come though overly large "wide"