Autosize Row Height using VB code

j2mbs

New Member
Joined
Jul 15, 2011
Messages
13
Hello everyone

I am currently trying to autosize the row height of a range of cells using the VB code I have entered below. The code works great but when I print my document some of the text in the cells is slightly cut off. I was hoping someone could be so kind as to show me how to modify my code below to add a buffer of say 5 to the already autosized row height. I've tried a few different ways based on other postings on the net and have been unsuccessful in doing so.

Thank you very much in advance!

P.S. I am new to this forum so I apologize if the way I posted my code is incorrect.

Private Sub Worksheet_Activate()
Application.EnableEvents = False
Me.Rows("6:1000").AutoFit
Application.EnableEvents = True
End Sub
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
Make sure the "Zoom" is set at 100%. This might help.
Also, make sure you are using standard font, like calibri or arial.
 
Upvote 0
Thank you very much for your suggestion but unfortunately I am still having trouble with some data being cut off.

I will continue to cross my fingers in hopes that someone can modify my simple code in my previous post.
 
Upvote 0

Forum statistics

Threads
1,224,587
Messages
6,179,733
Members
452,939
Latest member
WCrawford

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top