I have 1 listbox (lisbox1) that retrieve it's list items from a worksheet range (imported/database query from access). This works fine.
I have a second listbox (listbox2) that should display results from clicking a value in listbox1.
Listbox1 contains companynames (1 column), listbox2 needs to be populated with quotes.
Range A3:D4800 contains company ID's, Company names, Quote Numbers. When I select a company name in listbox1, I need listbox2 to be populated with all quotes for that company.
I have tried (using vba) to do a vlookup using the listbox1 value, but I cannot seem to figure out how to populate listbox2 with "all" quotes. I get 1 quote and that's it. I realize I probably need to have the vlookup loop through each cell in the range to find the value, but when I try this, I get a type mismatch when using the .additem (only for the 2nd and subsequent passes).
I have a userform where I can select multiple items in a listbox and add them to another. I also have the ability to filter the first listbox to make finding items easier. The issue I am having concerns the clear filter button. As currently designed, the clear filter button will reset the initial listbox back to its default values. Ideally, I would like it to reset to the default values excluding those values that currently in the second listbox.
The entire code is below for reference, but it's the sub ClearFilter_Click that I am struggling with.
I have the following sheet which functions as a table to store values for files that have been created using the application which this table is in. In this app., I have a form with 2 listboxes. When the form loads, I have the first listbox list values which each of these files are listed under (i.e. - "sub-directories"). With a selection of one of the list values and clicking of a button, I want the second list box to list the values of cells listed in a range directly below where the selected value in the first listbox came from.
I'd prefer, in the first listbox, to have only the values of the ranges that have a value in them in the listbox. However, this would cause my listbox.selected(array) not function properly. But since my current offsets (in the second sub) do not seem to be working anyway, maybe I am going about this totally wrong.
I have created a Userform with several 'Listsboxes'. I would like to populate these boxes from lists on a spreadsheet. Can someone please point me in the right direction using the 'VB Help' where I can get an example of the code
code the following on a userform initialize event to populate a list box: If the selected item in the list box SerialNumber = "none" (lower or upper case) then populate the list box lbSamDesc with all the unique entries on the sheet "EquipmentData" in Column C (from C3 on to last entry in C), where the corresponding B cell next to it is blank.
I have a workbook with about 25 different sheets and each sheet has the same in cell listboxes on them and If I get another item I need to add to them I have to go to each sheet and update them, is there a way to make one list to populate each list from?
I need to populate two listboxes, however, the value on the second box needs to derive from the first one, such as when I click on North America, USA and Canada would show up. the tricky part is that I need to be able to select North America and Europe in the same time and 2nd list box needs to show USA, Canada, UK, Italy, German accordingly.
A1: North America A2: Europe A3: Asia
B1: USA B2: Canada C1: UK C2: Italy C3: German D1: China D2: India
I am using Excel frontend and Access backend for my project. Now I want to write the code that will execute when the userform1 is loaded and populate data from Access table in to the 2 column listbox. I have written the following code but that doesn't work properly.
I am trying to populate a listbox in a userform with only certain data. Currently I am able to populate all rows in a worksheet but I need to have only rows with the current date to show. In col A is the date and col B is a persons name.
In my workbook i have worksheets that are named 01-Jan-2008,15-jan-2008,30-jan-2008...and i have almost 50 for each year.from 2007 to 2009. I have created a userform where i have a Year combobox with values 2007,2008,2009 and an ok button then in the same form, i have a listbox and an Ok button and a back button.
i want the user to be able to pick the Year from the combobox. once he specifies the year, the worksheets corresponding to that year should appear in the listbox...instead of populating it with all the 100+ wksheets i want the search narrowed down.
I am trying populate a listbox on a userform using the range of a4:a:30 from a sheet entitle names. I can do this singly using the additem command, but I am not sure how I can add a range, or if that is possible. this is my code so far:
Code: Private Sub UserForm_Initialize() With LBoNames .AddItem Sheets("names").Range("a1").Value End With End Sub
I want to create a userform that selects a Staff members name from a combo box, once selected the listbox would then display what time off that person has taken - ultimately I would then like to be able to select a date taken and either edit or delete it from the sheet that holds the information.
I am trying to populate a listBox with data from cells. I eventually want to be able to make the cells change by just adding more data into my worksheet.
Here is my code. It should fill my listBox with just cells A1:A11 (I can't figure out how to make it adjust for new data), however the code is returning this error: "Run-time error '91' Object variable or With block variable not set"
Option Explicit Sub PopulateListBox() Dim myList As Worksheet Dim x As Variant For Each x In myList.Range("A1:A11")
Attempting to populate a listbox from a worksheet range at runtime As far as I can tell the code is correct But the listbox returns results from ws("Data") not from ws("WA")
Sub comp_bs_AnalyzeAccounts() Dim wbBook As Workbook Dim wsWA As Worksheet Dim rngWA As Range Dim lngRows As Long Set wbBook = ThisWorkbook Set wsWA = wbBook.Worksheets("WA") comp_bs_XTract lngRows = wsWA.Range("A65536").End(xlUp).Row Set rngWA = wsWA.Range("A1:A" & lngRows).................
if is possible to make some kind of ComboBox without filters, I mean that let you choose different items at the same time. I do not know if some of you have seen some "ComboBox" that has all the options in one side and next to this window it has a blank window that when you double click the word that was in the other wondow passes to the other window telling you that you have chossen this item.
List 1 (TV Brand) Sony LG Samsung Depended List 2 (Models) Sony LG Samsung EX420 55EB9600 PL43E450A1FXZP EX430 77EC9800 PL43E490B4FXZP EX550 55EA8800 PL43E400U1FXZP EX520 KN55S9C UN32EH5300FXZP EX645 55EA9800 PL64E8000GFXZP
I'm using two Listboxes (Form Control) with multiple selection options namely Listbox 1 (Brand) & Listbox 2 (Models). I want listbox 2 input range to be depended on selection made on Listbox 1 (Brand). For example, if user selects Sony then box2 should show only Sony's models and if user selects Sony & LG, box2 should show models for both Sony & LG.
I am trying to take selected items from a listbox and put the selected items into an array. Basically I am trying to put the selected items into a variable that I can pass to other modules. I am close but something is off. I can't tell if it's the variable declaration or the code.
I get Run Time error 91. Object variable or with block variable not set
Using the Roy Cox Database code http://www.excel-it.com/vba_examples.htm , I am trying to populate a user form when the user selects a list row. I don't know if this is important, but I have extended my list beyond 10 columns. The list appears in UserForm2, and it should populate UserForm1. UserForm1 is also available to fill in from scratch; the info pulled from UserForm2 is from a search.
Here is my problem:
UserForm1 does not populate with the current selection, but rather the previous selection. It will appear blank upon the first selection. If I close UserForm2 after getting a blank on Form1 and call UserForm1 from its own macro, I will also see that previous selection.
I have systems that spit out text log files showing machine performance. Each log file has about 5000 lines of data in it which I import into excel for processing. One of the columns has a machine voltage that changes with the machine state. There might be 10-15 discrete values (like 500V, 800V, or 1000V) within the 5000 lines. I'm trying to populate a list box with just the discrete values so the user can choose what state to process for charting. Some log files might only have 2 or 3 voltages others might have 15 or more so it isnt fixed. I've been trying to use an advanced filter with copy to location and unique records selected but I run into problems with the variable size of the list and with the fact that the header repeats periodically and I can't seem to screen that out of the list.