LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default Rows().AutoFit starts a calculation, but Columns().AutoFit doesn't

Hi,

I can't replicate your problem but this should stop recursive calls

Private Sub Worksheet_Calculate()
Application.EnableEvents = False
Rows("10:20").AutoFit
Application.EnableEvents = True
End Sub

Mike

"Stefano" wrote:

This example copied from the help of the WorkSheet.Calculate event works well:
Private Sub Worksheet_Calculate()
Columns("A:F").AutoFit
End Sub

But it loops forever when I replace it with:
Private Sub Worksheet_Calculate()
Rows("10:20").AutoFit
End Sub

It looks like resizing the rows (even rows outside the UsedRange) causes the
volatile functions to be calculated, while resizing the columns doesn't.

Does it make sense?
How can I resize the rows after a calculation?

Thanks,
Stefano

 
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
Autofit (Columns.EntireColumn.AutoFit) does not work Michiel via OfficeKB.com Excel Discussion (Misc queries) 3 February 10th 09 05:29 PM
Autofit Columns falcios Excel Discussion (Misc queries) 2 February 17th 07 04:08 PM
AutoFit Columns in a new Worksheet Jon Peltier Excel Programming 1 January 7th 07 12:15 AM
Autofit some columns Me Excel Programming 2 February 20th 05 08:06 PM
Columns.Autofit not doing what I want Ed Excel Programming 2 October 25th 04 11:31 PM


All times are GMT +1. The time now is 07:06 AM.

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

About Us

"It's about Microsoft Excel"