- 帖子
- 49
- 主題
- 6
- 精華
- 0
- 積分
- 97
- 點名
- 0
- 作業系統
- xp
- 軟體版本
- Office2010
- 閱讀權限
- 20
- 性別
- 男
- 註冊時間
- 2011-8-24
- 最後登錄
- 2023-12-24
|
6#
發表於 2012-1-13 10:24
| 只看該作者
回復 5# GBKEE
請問G大我執行到這一段會出現錯誤
Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _
xlBetween, Formula1:="=" & bb
會出現錯誤
Sub 清單明細()
If ActiveCell.Cells.Column <> "4" Then Exit Sub
aa = ActiveCell
If aa = "" Then Exit Sub
g = Worksheets("清單明細").Cells(65536, 1).End(xlUp).Row
For i = 1 To g
If Worksheets("清單明細").Cells(i, 1) = aa Then
b = 0
For a = 4 To 34
kk(b) = Worksheets("清單明細").Cells(i, a)
b = b + 1
Next a
bb = Join(kk, ",")
'bb = Worksheets("清單明細").Cells(i, 3)
ActiveCell.Cells(, 4).Select
Exit For
End If
Next i
With Selection.Validation
.Delete
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _
xlBetween, Formula1:="=" & bb
.IgnoreBlank = True
.InCellDropdown = True
.InputTitle = ""
.ErrorTitle = ""
.InputMessage = ""
.ErrorMessage = ""
.ShowInput = True
.ShowError = True
End With
End Sub |
|