Quote:
If .ListIndex = -1 this means there is no selection
If there is no selection then .Text would be "" so Len(.Text) would be 0 and Val(0) would be zero
What do you think Val(Len(.Text)) would return as a boolean value?
|
Now I corrected as Below.
Not sure for a smooth operation because
Now What happens if i type for eg 2 and if that para is not there but 21, 32, 212 etc para are there. In this case how to implement smoothly with Msgbox "Para no 2 Does Not Exist"
and there is "Sky Blue" background behind the para no. digits. In this case also i had to select full Two digits or 3 digits with DarK Blue Colour for Complete para nos.
Why the selection cant operate automatically ?
Anything also can be worked out on the same for real smooth operation
Code:
Private Sub cmbParaNos_Change()
Dim i As Long
Dim oBkMrk As Bookmark
Dim wdActDoc As Document
Set wdActDoc = ActiveDocument
With cmbParaNos
If Not IsArrow Then .List = myArrayParaList
If .ListIndex <> -1 And Len(.Text) Then
For i = .ListCount - 1 To 0 Step -1
If InStr(1, .List(i), .Text, 1) = 0 Then .RemoveItem i
Next i
.DropDown
End If
End With
End Sub
SMehta
Thread 3: No: 46521 : Post No3 : TM 20