autocomplet numbers in combobox

white_flag

Active Member
Joined
Mar 17, 2010
Messages
331
hello

I have this problem and I do not know how to fix it:

I have an userform in Word, this is made from 10 comboboxes. The values from comboboxes are been taket from an excel file like this: Combo1=range("A2:A456") etc. In word (user form), I see the list from excel. but wen I type an number I like that, the combobox to show me match values. but nothing. This is happening just with the numbers, with letter it is going good. The setings from excel are for all the same. I try diffrent combination in combobox.properties but nothing. What can I do? The numbers in combo are important

this is the code:
Code:
option explicit

Private Sub ComboBoxA1_Change()
    Dim i As Integer
    For i = 1 To 9
        Controls("ComboBoxA" & i).ListIndex = ComboBoxA1.ListIndex
    Next
End Sub

Private Sub ComboBoxA2_Change()
    Dim i As Integer
    For i = 1 To 9
        Controls("ComboBoxA" & i).ListIndex = ComboBoxA2.ListIndex
    Next
End Sub

.
.
.

Private Sub ComboBoxA9_Change()
    Dim i As Integer
    For i = 1 To 9
        Controls("ComboBoxA" & i).ListIndex = ComboBoxA9.ListIndex
    Next
End Sub
Private Sub from_excel()
  With GetObject("D:\ooo.xls")
        ComboBoxA1.List = .sheets(1).Range("B2:B456").Value
        ComboBoxA2.List = .sheets(1).Range("K2:K456").Value
        ComboBoxA3.List = .sheets(1).Range("W2:W456").Value
        ComboBoxA4.List = .sheets(1).Range("Y2:Y456").Value
        ComboBoxA5.List = .sheets(1).Range("L2:L456").Value
        ComboBoxA6.List = .sheets(1).Range("M2:M456").Value
        ComboBoxA7.List = .sheets(1).Range("P2:P456").Value
        ComboBoxA8.List = .sheets(1).Range("D2:D456").Value 'numbers - not going
        ComboBoxA9.List = .sheets(1).Range("B2:B456").Value 'numbers - not going
        .Close False
  End With
End Sub

Private Sub UserForm_Initialize()
    from_excel
End Sub
 

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.

Forum statistics

Threads
1,224,590
Messages
6,179,758
Members
452,940
Latest member
rootytrip

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top