0
유효성 검사 목록을 셀에 할당하려고합니다. 유효성 검사 목록은 특정 셀의 값에 따라 달라질 수 있습니다. 예를 들어 "C6"셀의 값이 28이면 유효성 검사 목록은 Sheet4.Range ("b4 : b20") 범위 여야합니다. 유효성 검증 목록이 작업을 수행하는 또 다른 sheet.in 순서에서입니다 볼 수 있듯이 나는 이제 어떻게 셀에 나에게 표시되는 내용을 문자열 RNG의 값이 아니라는 것을 무엇 아래의 코드VBA를 사용하여 셀 유효성 검사
ValrStart = Sheet4.Cells(rowno, 4).Address ‘rowno is the row in which the validation list starts and its value comes from another part of the code
ValrEnd = Sheet4.Cells(rownoEnd, 4).Address rownoEnd is the row in which the validation list ends and its value comes from another part of the code
Rng = "Sheet4.Range(""" & ValrStart & Chr(58) & ValrEnd & """" & ")"
With Cells(20, 3).Validation
.Delete
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, _
Operator:=xlBetween, Formula1:=Rng
.ErrorMessage = "Invalid value. Select one from the dropdown list."
check = Cells(20, 3).Validation.Value
If check = False Then
Cells(20, 3).ClearContents
Exit Sub
End If
End With
을 썼다 범위를 나타냅니다. 아무도 도와 줄 수 있습니까? 감사