ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Autofit row height in only some rows (https://www.excelbanter.com/excel-programming/442663-autofit-row-height-only-some-rows.html)

JStiehl

Autofit row height in only some rows
 
Is it possible to change this macro to only autofit the row height on rows
254-332 in the workbook? I am using this macro:

Option Explicit
Private Sub Workbook_SheetCalculate(ByVal Sh As Object)
Application.EnableEvents = False
Sh.Rows.AutoFit
Sh.Rows("1.33").AutoFit
Application.EnableEvents = True
EndSub

Thanks in advance for your help.

p45cal[_278_]

Autofit row height in only some rows
 

VBA Code:
--------------------


Option Explicit
Private Sub Workbook_SheetCalculate(ByVal Sh As Object)
Application.EnableEvents = False
Sh.Rows("254:332").AutoFit
Application.EnableEvents = True
EndSub
--------------------


?


--
p45cal

*p45cal*
------------------------------------------------------------------------
p45cal's Profile: http://www.thecodecage.com/forumz/member.php?u=558
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=203770

http://www.thecodecage.com/forumz



All times are GMT +1. The time now is 07:20 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com