COMBOBOX VALUES

robertmwaring2

Board Regular
Joined
Mar 8, 2019
Messages
132
Office Version
  1. 365
Platform
  1. Windows
I have a userform that contains a mutlipage with 15 pages. All total, there are 475 comboboxes between the pages on this one form (yes i realize this is alot).
I am attempting to compile a list of all the combox values that are not left blank into a single column on a sheet within the workbook the form is apart of (Sheet3.Range("BC2:BC??"). I have used the following code previoulsy, but for whatever reason it now just loops endlessly IF any comboboxes on page 1 of the multipage are left blank.

VBA Code:
Dim Ctrl As Object
   For Each Ctrl In UFProductionSheet.Controls
      If TypeName(Ctrl) = "ComboBox" Then
         If Ctrl.Value <> "" Then
            Sheet3.Range("BC" & Rows.Count).End(xlUp).Offset(1).Value = Ctrl.Value
         End If
      End If
   Next

I really don't relish the idea of having to allocate a specific cell in the worksheet for each combobox to hold the value of the box on a change event, as I mentioned - there are 475 of them. The code above has worked flawlessly in the past, but I am in the process of creating a revised workbook that would allow for users to update more information and be less restrictive. Somewhere along the line, one of the changes I've made has caused this to stop functioning as it once did. I use the above code as a module that is called on a button click. Can anyone help me?
 
Last edited by a moderator:
We will call it a night... Save your work and think of the possibilities to come ! i kept 1 combobox code just for reference to see what was needed
 
Upvote 0

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
perfect already :) so your plan is to do the code again for listbox2 and 3?
try this instead

VBA Code:
Private Sub UserForm_Initialize()
    'populate listboxes 1 - 3
    With ListBox1
        .AddItem "Breakfast Buffet"
        .AddItem "Breakfat Plated"
        .AddItem "Breaks"
        .AddItem "Lunch Buffet"
        .AddItem "Lunch Plated"
        .AddItem "Apps and Stations"
        .AddItem "Dinner Buffet"
        .AddItem "Dinner Plated"
        .AddItem "Family Meal"
        .AddItem "Team Breakfast"
        .AddItem "Team Break"
        .AddItem "Team Lunch"
        .AddItem "Team Dinner"
        .AddItem "Blank Master"
    End With
  
    ListBox2.List = ListBox1.List
    ListBox3.List = ListBox1.List
End Sub

a list box is just a display tool for an array. the whole array is stored in the property ".List"
so i can copy the array from list to list
I have always found the indenting a bit confusing, but I am starting to come around to it. Question though, is the listbox2/3 at the location it is because it is new and not associated with the previous code, but not at the far left because it is still within the same sub? (if that made sense)
 
Upvote 0
We will call it a night... Save your work and think of the possibilities to come ! i kept 1 combobox code just for reference to see what was needed
I thank you so much! I have a feeling this will be better than I could have anticipated. Good night! And again, thank you so much!!
 
Upvote 0
I spent a bit of time thinking about the use of the comboboboxes today and one issue occurred to me. I think it might be a bit much to choose from a list of a possible 175 items in each drop down. While this will never likely occur for many of the menus (that many selections available), the Team menus are a concern with that reagrd. If it would help to keep things efficient and less difficult for me to comprehend, its a trade off I am willing to make - just a concern i thought of.
 
Upvote 0
hi i am on now for while. just need a few minutes. heres an easy task to think about
 

Attachments

  • Untitled-11.jpg
    Untitled-11.jpg
    198.2 KB · Views: 8
Upvote 0
hi i am on now for while. just need a few minutes. heres an easy task to think about
My sincerest apologies for being MIA for the past week. I live in Houston, Texas and I had been without power/water/internet/cell service for a few days.
I do like your idea with the userform for the eevnt details. I used to have a form for those details (though not nearly as nice as you what presented), but thought it might be easier to just use the sheet itself. I like your idea. Ill be available this eveing through about 10pm if you wish to speak.
 
Upvote 0
i am free atm. i have friends in UT and TX that have been complaining about the cold and disruption to services. when ever you would like to move on with the project you are welcome to see if i am about. my timezone is +10.00
 
Upvote 0
i am free atm. i have friends in UT and TX that have been complaining about the cold and disruption to services. when ever you would like to move on with the project you are welcome to see if i am about. my timezone is +10.00
I am available fur the remainder of the evening and am off work the next two days so I can devote as much time as needed to this.
 
Upvote 0
i am here now for a while. good timing. i have just finished a little project with some one else. about 150 messages LOL
 
Upvote 0
i am here now for a while. good timing. i have just finished a little project with some one else. about 150 messages LOL
Oh wow! I don't want to keep you if you'd rather rest. But I am free now as well if not.
 
Upvote 0

Forum statistics

Threads
1,215,449
Messages
6,124,911
Members
449,195
Latest member
Stevenciu

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