- 帖子
- 4901
- 主題
- 44
- 精華
- 24
- 積分
- 4916
- 點名
- 142
- 作業系統
- Windows 7
- 軟體版本
- Office 20xx
- 閱讀權限
- 150
- 性別
- 男
- 來自
- 台北
- 註冊時間
- 2010-4-30
- 最後登錄
- 2026-7-16
                
|
回復 4# wisad - Sub Eddie_OTP2()
- Application.ScreenUpdating = False
- fd = ThisWorkbook.Path & "\" '"C:\OTP\"'以相同目錄測試
- obs = Array("OTP1.xls", "OTP2.xls") '檔案列表
- r = 6 '寫入起始列位
- For i = 0 To 1
- With Workbooks.Open(fd & obs(i)) '開啟檔案
- For j = 13 To 15
- fstr = "CH" & ThisWorkbook.ActiveSheet.Cells(3, j)
- Set a = .Sheets(1).Rows("7:7").Find(fstr, lookat:=xlWhole) '搜尋
- If Not a Is Nothing Then ThisWorkbook.ActiveSheet.Cells(r, j) = Application.Max(a.EntireColumn)
- Next
- .Close
- r = r + 1
- End With
- Next
- End Sub
複製代碼 |
|