Results 1 to 4 of 4

Collect only one of the values in a combobox

Threaded View

  1. #1
    Registered User
    Join Date
    07-31-2016
    Location
    Holland
    MS-Off Ver
    2019
    Posts
    74

    Collect only one of the values in a combobox

    Hi All,

    I have the following code to collect only one of the values in row C into a ComboBox1.

    Now I want to change the code so that it still does the same, but than collect only the values from the visible cells.

    Dim myCollection As New Collection
    Dim oneCell As Range
    Dim oneString As Variant
    
    For Each oneCell In Range(Range("C2"), Range("C65536").End(xlUp))
       On Error Resume Next
       For Each oneString In Split(CStr(oneCell.Value), ",")
           myCollection.Add Item:=oneString, Key:=oneString
       Next oneString
       On Error GoTo 0
    Next oneCell
    
    With UserForm1.ComboBox1
       For Each oneString In myCollection
            .AddItem oneString
       Next oneString
    End With
    Last edited by Wijnand1; 01-26-2019 at 06:12 AM. Reason: fault

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Move/collect values to into one row
    By Bjourne in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-26-2019, 07:19 PM
  2. Collect rows with specific values and then comiple
    By Cooltrain in forum Excel General
    Replies: 14
    Last Post: 07-18-2016, 08:39 PM
  3. Collect cell values in 3 cells from certain worksheets
    By rosshkerr in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-22-2016, 03:29 PM
  4. [SOLVED] Collect Unique Values from area
    By filkod in forum Excel Formulas & Functions
    Replies: 18
    Last Post: 05-16-2016, 09:13 PM
  5. Replies: 1
    Last Post: 04-19-2012, 11:43 AM
  6. Macro to collect average values
    By bigband1 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 12-21-2011, 08:01 PM
  7. Textbox and combobox to collect data from sheet
    By john55 in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 12-27-2010, 07:25 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1