Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Tom solved one issue...using a variable in the array...but I still nee
to eliminate the blank lines that this generates... I want it to ONLY add lines the satisfy the conditions of the I statement. currently it will add a line with NO DATA if the statemen is false.. Sub PopulateBox() Dim data() Set PackagesAvailable = ThisWorkbook.Sheets("BrandCount") Packcount Application.WorksheetFunction.CountA(PackagesAvail able.Range("A:A")) Dim i As Integer ListBox1.Clear ReDim data(1 To Packcount, 1 To 2) On Error Resume Next For i = 1 To Packcount If Sheet10.Cells(i, 1) = cbstate.Value Then data(i, 1) = PackagesAvailable.Cells(i, 2).Value data(i, 2) = PackagesAvailable.Cells(i, 3).Value End If Next i ListBox1.ColumnCount = 2 ListBox1.list = data End Su -- Message posted from http://www.ExcelForum.com |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Eliminating blanks | Excel Worksheet Functions | |||
Adding items to columns in a listbox | Excel Discussion (Misc queries) | |||
Adding Items to ListBox-eliminating Blanks | Excel Programming | |||
Adding Items to a LISTBOX--eliminating Blank Lines | Excel Programming | |||
Adding items to a spreadsheet from a user form listbox | Excel Programming |