- 帖子
- 49
- 主題
- 6
- 精華
- 0
- 積分
- 97
- 點名
- 0
- 作業系統
- xp
- 軟體版本
- Office2010
- 閱讀權限
- 20
- 性別
- 男
- 註冊時間
- 2011-8-24
- 最後登錄
- 2023-12-24
|
10#
發表於 2012-1-16 18:18
| 只看該作者
回復 8# GBKEE
再請問G大一下
為何我的警告訊息不會出現
Sub 清單明細()
Dim bb, kk(30), aa
If ActiveCell.Cells.Column <> "4" Then Exit Sub
aa = ActiveCell
If aa = "Account Code " Then Exit Sub
If aa = "" Then Exit Sub
g = Worksheets("清單明細").Cells(65536, 2).End(xlUp).Row
For i = 1 To g
e = Worksheets("清單明細").Cells(i, 2)
If Worksheets("清單明細").Cells(i, 2) = aa Then
b = 0
j = Worksheets("清單明細").Cells(i, 34).End(xlToLeft).Column
For a = 3 To j
kk(b) = Worksheets("清單明細").Cells(i, a)
b = b + 1
Next a
bb = Join(kk, ",")
Exit For
End If
Next i
pp = Worksheets("清單明細").Cells(i, 3)
MsgBox pp, , "Account_Code說明"
ActiveCell.Cells(, 4).Select
ActiveCell = ""
With Selection.Validation
.Delete
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _
xlBetween, Formula1:=bb
.IgnoreBlank = True
.InCellDropdown = True
.InputTitle = ""
.ErrorTitle = ""
.InputMessage = ""
.ErrorMessage = "You must enter a number from five to ten"
.ShowInput = True
.ShowError = True
End With
Set kk(30) = Nothing
ActiveCell.Offset(, -5) = Date
ActiveCell.Offset(, 1) = Environ("UserName")
End Sub |
|