Em đang làm code List mà nó báo lỗi application-defined or object-defined error (1 người xem)

Liên hệ QC

Người dùng đang xem chủ đề này

levanson18794

Thành viên mới
Tham gia
22/7/15
Bài viết
2
Được thích
0
Public Sub asd()
i = 15
While Sheet3.Cells(i, "B") <> ""
With Sheet3.Range("O" & i).Validation
.Delete
'replace "=A1:A6" with the range the data is in.
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, _
Operator:=xlBetween, Formula1:="=sheet1!A1:A14"
.IgnoreBlank = True
.InCellDropdown = True
.InputTitle = ""
.ErrorTitle = ""
.InputMessage = ""
.ErrorMessage = ""
.ShowInput = True
.ShowError = True
End With
i = i + 1
Wend
End Sub
 

File đính kèm

  • Untitled.jpg
    Untitled.jpg
    22.6 KB · Đọc: 21
Public Sub asd()
i = 15
While Sheet3.Cells(i, "B") <> ""
With Sheet3.Range("O" & i).Validation
.Delete
'replace "=A1:A6" with the range the data is in.
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, _
Operator:=xlBetween, Formula1:="=sheet1!A1:A14"
.IgnoreBlank = True
.InCellDropdown = True
.InputTitle = ""
.ErrorTitle = ""
.InputMessage = ""
.ErrorMessage = ""
.ShowInput = True
.ShowError = True
End With
i = i + 1
Wend
End Sub

Xem lại chỗ màu đỏ! Coi chừng file của bạn chẳng có cái Sheet1 nào cả
 
Upvote 0
Web KT

Bài viết mới nhất

Back
Top Bottom