adding code to shrink columns to reasonable width

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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"
 
Sub Cleanup()
With ActiveWorkbook
.Names("Database").Delete
Application.DisplayAlerts = False
.SaveAs .FullName, xlWorkbookNormal
Application.DisplayAlerts = True
Activesheet.columns.Autofit
End With
End Sub
 
Hey Tom I did not want to continue to bother you - I do apprecaite your
additional time.

I got involved with somehting that it looks like I will fianlly be able to
get into some good VBA work.

Todd
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top