Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Excel VBA - StandardWidth property

Posted on 2014-07-21
2
Medium Priority
?
358 Views
Last Modified: 2014-07-23
I have about 14 columns which have been modified to different sizes.  I would like to bring them all back to the standard width as defined in the properties window.  What is the VBA code to do this?
0
Comment
Question by:brothertruffle880
2 Comments
 
LVL 13

Assisted Solution

by:duncanb7
duncanb7 earned 1000 total points
ID: 40208565
Try this as follow

Duncan

Sub test()
ActiveSheet.Columns.EntireColumn.ColumnWidth = ActiveSheet.StandardWidth
End Sub

Open in new window

0
 
LVL 85

Accepted Solution

by:
Rory Archibald earned 1000 total points
ID: 40208589
You can also use:
Range("A:N").UseStandardWidth = True

Open in new window

for specific columns for example.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
Microsoft's Excel has many features that most people will never need nor take advantage of.  Conditional formatting is one feature that you may find a necessity once you start using it.
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.
This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question