- 帖子
- 2035
- 主題
- 24
- 精華
- 0
- 積分
- 2031
- 點名
- 0
- 作業系統
- Win7
- 軟體版本
- Office2010
- 閱讀權限
- 100
- 性別
- 男
- 註冊時間
- 2012-3-22
- 最後登錄
- 2024-2-1
|
16#
發表於 2013-8-18 09:21
| 只看該作者
本帖最後由 c_c_lai 於 2013-8-18 09:22 編輯
回復 15# yliu
將你目前的 Report 予以稍稍整理一下,方便閱讀及縮小(精簡)程式碼。
供你參考與應用:- Private Sub ComboBox1_Change()
- Dim d As Object, j As Integer
-
- Sheets("report").Unprotect ("789456123")
- ClearFlds
複製代碼- If dic.Count = 0 Then
- MsgBox "沒有議價資料"
- ClearFlds
- Exit Sub
- End If
複製代碼- Sub ClearFlds()
- With Sheets("report")
- ' .Cells(5, 2) = ""
- ' .Cells(6, 2) = ""
- ' .Cells(7, 2) = ""
- ' .Cells(8, 2) = ""
- ' .Cells(9, 2) = ""
- ' .Cells(10, 2) = ""
- ' .Cells(13, 2) = ""
- ' .Cells(14, 2) = ""
- ' .Cells(15, 2) = ""
- ' .Cells(16, 2) = ""
- ' .Cells(18, 2) = ""
- ' .Cells(19, 2) = ""
- ' .Cells(20, 2) = ""
- ' .Cells(21, 2) = ""
- .Range("B5:B10") = ""
- .Range("B13:B21") = ""
-
- ' .Cells(13, 3) = ""
- ' .Cells(14, 3) = ""
- ' .Cells(15, 3) = ""
- ' .Cells(16, 3) = ""
- .Range("C13:C16") = ""
-
- .Cells(5, 4) = ""
- ' .Cells(9, 4) = ""
- ' .Cells(10, 4) = ""
- .Range("D9:D10") = ""
-
- ' .Cells(13, 4) = ""
- ' .Cells(14, 4) = ""
- ' .Cells(15, 4) = ""
- ' .Cells(16, 4) = ""
- ' .Cells(20, 4) = ""
- ' .Cells(21, 4) = ""
- .Range("D13:D21") = ""
- End With
- End Sub
複製代碼
ReportB.rar (23.43 KB)
|
|