- 1). Add the "Developer" tab to the menu ribbon if you haven't already done so. Do this by clicking on the "File" tab on the left end of the menu ribbon. Click on "Options" and then on "Customize Ribbon" in the categories pane. Select "Developer" from the list of main tabs and then click "OK." The "Developer" tab should now appear in the ribbon.
- 2). Click on the Developer tab and then on "Visual Basic" to open the Visual Basic Editor window.
- 3). Insert the following line into your macro's code to use VB script to autofit cells in Excel:
The information in parentheses after "Worksheets" is the name of your worksheet (usually "Sheet1"). The information in the parentheses after "Range" is the range of columns or rows or the single cell you want to autofit. You can change "Columns" to "Rows" if you want to autofit the height of the cell(s) rather than the width.
EDITOR PICKS & Articles
- Hire the Reliable Builders and Installers to Have Beautiful Home Improvements
- How to Choose the Right Curtains For Your Home
- Room Decor of Different Time Periods
- How to Decorate Mahogany Floors
- Nursery Furniture Ideas
- Types of Wall Covering
- How to Paint Your House & Make Every Room Look Great
- Choosing Window Blinds Sydney
- How to Create a Decorative Mirror with Tile
- Ladybug Wall Decorations
Subscribe to our newsletter
Sign up here to get the latest news, updates and special offers delivered directly to your inbox.
You can unsubscribe at any time
Stay With Us