내 워크 시트의 모양을 반복하여 드롭 다운인지 확인한 다음 특정 드롭 다운이 특정 행에있는 경우 확인하고 싶습니다. 워크 시트에는 많은 확인란과 드롭 다운이 있습니다. 다음,다양한 셰이프가 포함 된 워크 시트에서 셰이프 유형을 어떻게 결정합니까?
ActiveSheet.CheckBoxes.Add(Range(chkbxAddress).Left, Range(chkbxAddress).Top, Range(chkbxAddress).Width, Range(chkbxAddress).Height).Select
With Selection
.Caption = ""
.Value = xlOff
.LinkedCell = AnsPositionRng.Offset(0, -4).Address
.Display3DShading = True
End With
범위의 특정 셀이 '참'이 포함 된 경우 :
wsBank.DropDowns.Add(Range(AnsPositionAddress).Left, Range(AnsPositionAddress).Top, Range(AnsPositionAddress).Width, Range(AnsPositionAddress).Height).Select
With Selection
'.ListFillRange = AnsPositionRng.Offset(0, 1)
'.LinkedCell = AnsPositionRng.Offset(0, 1)
.DropDownLines = 4
.Display3DShading = False
.Name = "QuestionDrop" & QuizQuestionNumber
.OnAction = "recordAnswer"
End With
Number = 1
For Each Q In AnsRng
wsBank.DropDowns("QuestionDrop" & QuizQuestionNumber).AddItem Number & " - " & Q
Number = Number + 1
Next Q
그리고 아래 확인란을 만드는 오전 : 나는 다음과 같이 루프로 드롭 다운을 만드는 오전 같은 행에있는 드롭 다운을 찾고 싶습니다. 그래서 모양을 반복하고 도형이 드롭 다운인지 확인한 다음 BottomRight Cell 속성을 확인하여 'True'가 포함 된 행과 일치하는지 확인합니다. '. 이것이 가능합니까? 내가 가지고 지금까지 같이 당신은 데이터 유효성 검사를위한 그 드롭 다운을 찾을 수
Sub IdentifyShapes()
Dim s As Shape
For Each s In ActiveSheet.Shapes
MsgBox s.Type & vbCrLf & s.Name
Next s
End Sub
유형을
8을하고
드롭 다운 1
같은 이름을 가지고 :
wsBank.Activate
With wsBank
IndicatorLstRow = .Range("C" & .Rows.Count).End(xlUp).Row
Set IndicatorRng = wsBank.Range("B4:B" & IndicatorLstRow)
End With
For Each c In IndicatorRng
If c = "True" Then
QuestionRow = c.Row
For Each ComboShape In wsBank.Shapes
test = ComboShape.Type
Next ComboShape
End If
Next c
Siddharth 대단히 감사합니다. 나는 'Gary 's Student'가 아래에 쓴 것과 비슷한 모양을하고 있었고 모양 유형 8을 보았습니다. 그러나 나는 워크 시트에 체크 상자와 드롭 다운을 모두 가지고 있었기 때문에 저를 버렸습니다. 감사합니다 aagin! – mccreaVBA