圖一
Sub REPORT()
WNM = ActiveWindow.Caption
Dim fn As String
fn = Application.GetOpenFilename("所有文件,*.*")
If fn = "" Or fn = "False" Then Exit Sub
Workbooks.Open Filename:=fn
WNM1 = ActiveWindow.Caption
Sheet46.Select
SHTNM = ActiveSheet.Name
Do Until Range("H3") = "mm"
Application.Run "'" & WNM1 & "'!Ch_Unit"
Loop
Windows(WNM).Activate
A = Sheets("VBA").Range("B3")
B = 7
Do Until A > Sheets("VBA").Range("B3")
Do Until Range("I" & A) <> ""
A = A + 1
Loop
If Workbooks(WNM1).Worksheets(SHTNM).Range("B" & B) = "CO COPPER THICKNESS:" Or Workbooks(WNM1).Worksheets(SHTNM).Range("B" & B) = "SO COPPER THICKNESS:" Then B = B + 1
Do Until Workbooks(WNM1).Worksheets(SHTNM).Range("I" & B) <> ""
B = B + 1
Loop
Range("J" & A) = Workbooks(WNM1).Worksheets(SHTNM).Range("I" & B)