- 帖子
- 4901
- 主題
- 44
- 精華
- 24
- 積分
- 4916
- 點名
- 142
- 作業系統
- Windows 7
- 軟體版本
- Office 20xx
- 閱讀權限
- 150
- 性別
- 男
- 來自
- 台北
- 註冊時間
- 2010-4-30
- 最後登錄
- 2026-7-16
                
|
2#
發表於 2014-3-28 16:16
| 只看該作者
回復 1# 妤璇
出貨單模組- Private Sub Worksheet_Change(ByVal Target As Range)
- Dim Ar(), s%
- Application.EnableEvents = False
- If Target.Address = "$H$5" Then
- With Sheets("出貨清單")
- For Each a In .Range(.[L3], .[L3].End(xlDown))
- If a = Target Then
- m = a.Offset(, -2).Value
- ReDim Preserve Ar(s)
- Ar(s) = Application.Transpose(Application.Transpose(a.Offset(, -11).Resize(, 8).Value))
- s = s + 1
- End If
- Next
- End With
- Range([A9].Resize(, 8), [A9].Resize(, 8).End(xlDown)).ClearContents
- [C3] = m
- [A9].Resize(s, 8) = Application.Transpose(Application.Transpose(Ar))
- End If
- Application.EnableEvents = True
- End Sub
複製代碼 |
|