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
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