How to Preserve Column Width Formatting After Data Refresh in Excel 2013

I'm stumped!

Using Excel 2013, I have the following Macro:

Sub Macro7()
    Sheets("Full DataSet").Select
    Sheets("Parish Council").Select
End Sub

Open in new window

If I do the commands manually, that is:

Select the Worksheet
Refresh All the Data
Press <Alt> OCA (to do AutoWidth)

The commands work.  BUT in a macro, zippo, nada, zilch, nothing.  Refresh works but the columnwidth will not go back.

Any thoughts would be greatly appreciated.

Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

for the autofit multiple columns, you can use this macro:
Worksheets("Parish Council").Columns("A:I").AutoFit

Open in new window

If you only have 1 column, you can do like this:
Worksheets("Parish Council").Columns("A:A").AutoFit

Open in new window

Just need to put the good sheet name and the good columns.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
At the end, your full macro can look like:
Worksheets("Parish Council").Columns("A:AA").AutoFit

Open in new window

This is if the columns you want to autofit are A to AA. You can adjust.

Also the Refreshall will be done.

Can you give it a try?
LCSLouisJJamesAuthor Commented:
Perfect.  Excellent answer and it worked.  Thanks.
I'm glad i was able to help.

Have you also tried my last answer?

You can simplify the full macro like this:

Worksheets("Parish Council").Columns("A:AA").AutoFit

Open in new window

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Excel

From novice to tech pro — start learning today.