Excel不会插入列

我有一个不允许插入新列的工作簿。 这是一个macros启用的工作簿,我相信这是问题的原因。 当我插入一个新的列时,除了页面上的一个activeXbutton移动到右边以外,没有任何事情发生。 我怎样才能解决这个问题??

这是一个正在发生的事情的GIF。 注意在右上angular的button移动到每个插入的权利

插入错误GIF

macros是一个循环,它将数据范围从最高到最低的转换速率进行sorting,并添加一个单位的自由分配,直到没有剩余的分配。 简化片段:

Sub SecondaryDistrLoop() Application.ScreenUpdating = False 'Set variables 'Calculate the worksheet to ensure all formulas are up to date ActiveSheet.Calculate 'get secondary allocation amount to distribute AmountToDistribute = Range("Q2") 'get address of title cell where secondary allocaton goes (TITLED: Natl Reserve Discretionary) Cells.Find(What:="Natl Reserve Discretionary", After:=ActiveCell, LookIn:=xlFormulas, LookAt:= _ xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False _ , SearchFormat:=False).Activate Set AllocationAdjustmentTitleCell = Range(ActiveCell, ActiveCell) 'get address of Dec Turn Rate column to sort on Cells.Find(What:="Dec Turn Rate", After:=ActiveCell, LookIn:=xlFormulas, LookAt:= _ xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False _ , SearchFormat:=False).Activate 'get address of title cell for sorting column TITLE: (New DS on 3 Mth Avg Sales) SortColumnAddressString = ActiveCell.Address(Rowabsolute:=False, columnabsolute:=False) SortColumnReferenceString = Left(SortColumnAddressString, 1) ChartTitleRowNumber = Right(SortColumnAddressString, 1) 'Find Range of dealers to be sorted - aka finding range until the national summary rows Cells.Find(What:="Code", After:=ActiveCell, LookIn:=xlValues, LookAt:= _ xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=True _ , SearchFormat:=False).Activate LastRow = ActiveCell.End(xlDown).Row - 1 LastColumn = ActiveCell.End(xlToRight).Column + 17 Set DataRange = Range(Cells(ActiveCell.Row + 1, ActiveCell.Column), Cells(LastRow, LastColumn)) AllocationAdjustmentTitleCell.Activate 'start loop Do Until AmountToDistribute = 0 'update formulas ActiveSheet.Calculate 'Sort data to bring highest days supply to the top of list - range is built of dynamically finding column name New DS on 3 mth avg sales DataRange.Sort key1:=Range(SortColumnReferenceString & ChartTitleRowNumber + 1 & ":" & SortColumnReferenceString & LastRow), _ order1:=xlDescending, Header:=xlNo 'set lowest days supply to increase secondary allocation by 1 AllocationAdjustmentTitleCell.Offset(1, 0) = AllocationAdjustmentTitleCell.Offset(1, 0).Value + 1 'reduce the amount to distribute by 1 AmountToDistribute = AmountToDistribute - 1 Loop Application.ScreenUpdating = True End Sub 

从networking位置处理文件是个问题。 我把这个文件放到我的本地驱动器上,并且全部修好了……昏昏沉沉的