If Not IsArrow Then .List = 'What to syntax here to get full list of loaded ComboBox List when Form Initialized

SamDsouza

Board Regular
Joined
Apr 16, 2016
Messages
205
Hello
Can anyone help me to get the right syntax which is mentioned in RED bold below
Code:
Option Explicit
Public idx As Long
Private IsArrow As Boolean

Private Sub UserForm_Initialize()
 Load UserForm1
 UserForm1.Show vbModeless

 Dim rng As Range
   
   For Each rng In Sheet1.Range("B:B").SpecialCells(xlConstants).Areas
      With Me.ComboBox1
         .AddItem rng(1).Value
      End With
   Next rng
End Sub

Private Sub ComboBox1_Change()
  Dim i As Long
   With ComboBox1
   If Not IsArrow Then .List = [B][COLOR=#ff0000]'What to syntax here to get full list of loaded ComboBox List when Form Initialized[/COLOR][/B]
        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
SamD
 
Last edited:

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
You can put the list from a combobox into an array like this.
Code:
Dim arrItems As Variant

    arrItems = ComboBox1.List
 
Upvote 0

Forum statistics

Threads
1,223,893
Messages
6,175,240
Members
452,621
Latest member
Laura_PinksBTHFT

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