- 帖子
- 4901
- 主題
- 44
- 精華
- 24
- 積分
- 4916
- 點名
- 120
- 作業系統
- Windows 7
- 軟體版本
- Office 20xx
- 閱讀權限
- 150
- 性別
- 男
- 來自
- 台北
- 註冊時間
- 2010-4-30
- 最後登錄
- 2025-5-18
               
|
17#
發表於 2012-5-10 19:49
| 只看該作者
本帖最後由 Hsieh 於 2012-5-10 19:50 編輯
回復 16# sax868 - Sub InputData()
-
- Dim Sh As Worksheet, Ar()
-
- Set d = CreateObject("Scripting.Dictionary")
-
- Set d1 = CreateObject("Scripting.Dictionary")
-
- With Sheets("Updated Data")
-
- For Each a In .Range(.[A2], .Cells(.Rows.Count, 1).End(xlUp))
-
- If a.Offset(, 49) <> "" Then d(a & a.Offset(, 3) & a.Offset(, 12)) = a.Offset(, 49).Value 'AX有值才執行
-
- If a.Offset(, 37) <> "" Then d1(a & a.Offset(, 3) & a.Offset(, 12)) = a.Offset(, 37).Value 'AL有值才執行
-
- Next
-
- End With
-
- For Each Sh In Sheets
-
- With Sh
-
- r = 12
-
- Do Until .Cells(r, 1) = ""
-
- .Cells(r, "AU") = d(.[C1] & .Cells(r, "A") & .Cells(r, "J"))
-
- .Cells(r, "AI") = d1(.[C1] & .Cells(r, "A") & .Cells(r, "J"))
-
- r = r + 1
-
- Loop
-
- End With
-
- Next
-
- End Sub
複製代碼 |
|