Embedded code to auto re-size columns no longer working in win10/excel2016

paquirl

Board Regular
Joined
Oct 12, 2010
Messages
226
Office Version
  1. 2016
Platform
  1. Windows
I had this embedded code in a worksheet to auto re-size columns. When I upgraded to win10/excel2016 it no longer works. Please help!

Code:
Option Explicit

Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
    Application.ScreenUpdating = False
    ActiveSheet.Columns.AutoFit
End Sub
 

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest
If you run this
Code:
Sub chk()
Application.EnableEvents = True
End Sub
does your code work again?
 
Upvote 0
actually it works now on some columns ... :(
i'll try yours
 
Last edited:
Upvote 0
Apparently my old code still works, but it's slowwwwww.
Also, excel2016 is disabling my macros and i have to hit a button to enable them on each wkbk. Do you know where the setting to toggle this feature is located so the macros are enabled by default?
 
Upvote 0
Its in File > Options >Trust center > Trust center settings
 
Upvote 0

Forum statistics

Threads
1,223,893
Messages
6,175,240
Members
452,621
Latest member
Laura_PinksBTHFT

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