0

您好我有错误“无法完成操作:表格不能与数据透视表、查询结果、表格、合并单元格或 XML 映射重叠”这是什么意思它一直工作到今天,现在它已经坏了。请帮我。

  Sub CopyCurrentRegion()
Application.ScreenUpdating = False
Application.EnableEvents = False

Application.Calculation = xlCalculationManual
    Sheets("owssvr").Range("Table_owssvr").ListObject.QueryTable.Refresh BackgroundQuery:=False 'refresh and copy data base to the main view
    Range("Table_owssvr[#All]").Copy Sheets("NA").Range("A6")
    Sheets("NA").Columns("A:AC").EntireColumn.AutoFit

Dim c As Range

    For Each c In Range("A5:ae5").Cells
        If c.VALUE = "y" Then
            c.EntireColumn.Hidden = True     'hide all  columns where in range a5 to ae5 we have IN CELLS value x (maybe we will need this column). If u wana unhide this columns then  push other button :)
        End If
    Next c

If Weekday(Now()) = vbMonday Then
    ActiveSheet.ListObjects(1).Range.AutoFilter Field:=12, _
    Criteria1:=">=" & CLng(Date) - 4, Operator:=xlAnd, Criteria2:="<=" & CLng(Date)
Else
If Weekday(Now()) = vbTuesday Then
    ActiveSheet.ListObjects(1).Range.AutoFilter Field:=12, _
    Criteria1:=">=" & CLng(Date) - 4, Operator:=xlAnd, Criteria2:="<=" & CLng(Date)       ' filter fresh date(last date cut 24 h)
Else
    ActiveSheet.ListObjects(1).Range.AutoFilter Field:=12, _
    Criteria1:=">=" & CLng(Date) - 2, Operator:=xlAnd, Criteria2:="<=" & CLng(Date)
End If
End If
With Sheets("NA")
        .ListObjects(1).Name = "europe"
End With
Application.Calculation = xlCalculationAutomatic
Application.EnableEvents = True
Application.ScreenUpdating = True
End Sub
4

0 回答 0