Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 31
Default adding code to shrink columns to reasonable width

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"

  #2   Report Post  
Posted to microsoft.public.excel.programming
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"



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 31
Default adding code to shrink columns to reasonable width

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

"Tom Ogilvy" wrote:

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"




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Expand and Shrink Rows and columns to hide information. jf1847 Excel Discussion (Misc queries) 2 July 2nd 12 01:48 AM
Can I expand & shrink columns? youngsequan Excel Discussion (Misc queries) 1 December 4th 09 11:44 PM
Can rows/columns Automaticly Grow/Shrink? Brw Excel Discussion (Misc queries) 0 March 24th 06 02:29 PM
Shrink and expand a number of columns/rows balles Excel Worksheet Functions 1 February 17th 06 04:31 PM


All times are GMT +1. The time now is 06:14 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"