I need to autofit columns B to D but the following code creates an error?
Thanks in advance![]()
Worksheets("Cash Flow").Activate Activesheet.Columns("B:D").AutoFit
I need to autofit columns B to D but the following code creates an error?
Thanks in advance![]()
Worksheets("Cash Flow").Activate Activesheet.Columns("B:D").AutoFit
Works for me but you don't need to activate the sheet
Which line of code errors? What is the error? Does the Cash Flow sheet exist? Is the Cash Flow sheet protected?![]()
Worksheets("Cash Flow").Columns("B:D").AutoFit
Trevor Shuttleworth - Retired Excel/VBA Consultant
I dream of a better world where chickens can cross the road without having their motives questioned
'Being unapologetic means never having to say you're sorry' John Cooper Clarke
Thanks for your reply.
Sheet was protected...
All sorted now.
You're welcome.
Also, you may not be aware that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of those who helped.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks