Sub 複製A表到總覽()
總覽_Nm$ = Dir(Module1.NewName)
With Workbooks(總覽_Nm)
ThisWorkbook.Sheets("A").Copy After:=.Sheets(.Sheets.Count)
.Sheets(1).Activate '回到資料檔
End With
End Sub
Sub 於總覽刪除A表()
Application.DisplayAlerts = False
總覽_Nm$ = Dir(Module1.NewName)
Workbooks(總覽_Nm).Sheets("A").Delete
End Sub
改為
Sub 複製A表到總覽()
總覽_Nm$ = Mid(Module1.NewName, InStrRev(Module1.NewName, "\") + 1)
With Workbooks(總覽_Nm)
ThisWorkbook.Sheets("A").Copy After:=.Sheets(.Sheets.Count)
.Sheets(1).Activate '回到資料檔
End With
End Sub
Sub 於總覽刪除A表()
Application.DisplayAlerts = False
總覽_Nm$ = Mid(Module1.NewName, InStrRev(Module1.NewName, "\") + 1)
Workbooks(總覽_Nm).Sheets("A").Delete
End Sub
Sub DATA檔_AAA表_公式()
Dim AAA_Fx$(4), xR As Range, N%, xArea
AAA_Fx(1) = "=SMALL(IF(INDEX(A!$B$2:$S$51,,ROW($A1))="""",A!$A$2:$A$51),COLUMN(A$1))"
AAA_Fx(2) = "=SMALL(IF(INDEX(A!$V$2:$AM$51,,ROW($A1))="""",A!$A$2:$A$51),COLUMN(A$1))"
AAA_Fx(3) = "=SMALL(IF(INDEX(A!$AP$2:$BG$9,,ROW($A1))="""",A!$A$2:$A$9),COLUMN(A$1))"
AAA_Fx(4) = "=SMALL(IF(INDEX(A!$BJ$2:$CA$9,,ROW($A1))="""",A!$A$2:$A$9),COLUMN(A$1))"
For Each xR In Sheets("AAA").Range("B2,B52, B102, B152")
N = N + 1
xR.FormulaArray = AAA_Fx(N)
xR.Copy xR(1, 2).Resize(1, 48)
xR.Resize(1, 49).Copy xR(2, 1).Resize(17, 49)
With xR.Resize(18, 49)
.Value = .Value
.Replace "#*", "", lookat:=xlWhole
End With
Next
End Sub作者: ziv976688 時間: 2021-1-16 16:04