phuvacgach
Thành viên chính thức


- Tham gia
- 13/3/11
- Bài viết
- 56
- Được thích
- 9
Dear anh chị,
Em cần tạo Droplist Validation vs data Source là Array mà không biết gán vào phần Formular như thế nào?
Anh chị nào biết giúp em nhé.
Em cần tạo Droplist Validation vs data Source là Array mà không biết gán vào phần Formular như thế nào?
Anh chị nào biết giúp em nhé.
HTML:
Sub test()
Dim Route2()
Route2 = GetRoute2
With Selection.Validation
.Delete
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _
xlBetween, Formula1:="=Route2" 'Cho nay em khong biet gan Formular nhu the nao?
.IgnoreBlank = True
.InCellDropdown = True
.InputTitle = ""
.ErrorTitle = ""
.InputMessage = ""
.ErrorMessage = ""
.ShowInput = True
.ShowError = True
End With
End Sub
Function GetRoute2()
Dim Route2(1 To 3, 1 To 1)
Route2(1, 1) = "a"
Route2(2, 1) = "b"
Route2(3, 1) = "c"
GetRoute2 = Route2
End Function