Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Private Sub Worksheet_SelectionChange(ByVal Target As Range)
- If Selection.Count = 1 Then
- If Not Intersect(Target, Range("A:A")) Is Nothing Then
- Dim cb As Object
- Dim combineRange As Range
- Dim boolStr As String
- Dim floatStr As String
- Dim booleanRange As Range
- Dim floatRange As Range
- Dim bRow As Integer
- bRow = Worksheets("DEF_BOOLEAN").Cells(Rows.Count, 1).End(xlUp).Row
- Dim fRow As Integer
- fRow = Worksheets("DEF_FLOAT").Cells(Rows.Count, 1).End(xlUp).Row
- boolStr = "A2:A" & bRow
- floatStr = "A2:A" & fRow
- Set booleanRange = Worksheets("DEF_BOOLEAN").Range(boolStr)
- Set floatRange = Worksheets("DEF_FLOAT").Range(floatStr)
- Set combineRange = Worksheets("FT_CASE_xx").Range(booleanRange.Address & ":" & floatRange.Address)
- Set cb = Worksheets("FT_CASE_xx").OLEObjects.Add(ClassType:="Forms.ComboBox.1", Link:=False, DisplayAsIcon:=False, Left:=Target.Left, Top:=Target.Top, Width:=Target.Width, Height:=Target.Height).Object
- cb.ListFillRange = combineRange
- End If
- End If
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement