Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
loading data into a listbox faster
I have a spreadsheet full of data in this format for a theatre i work
at. Because there are multiple entries for one person I load all the names into a collection and then use this function (below) to load them into a listbox. While this method does work it quickly becomes very slow as we have hundreds of costumers. I was hoping someone could help me speed it up. Thanks last name, first name --- seat number ---- adult or student ticket ---- paid or not paid ReDim data(1 To nodupes.Count, 1 To 4) On Error Resume Next For Each Item In nodupes f = f + 1 For c = 1 To 669 'For r = 1 To 28 If ActiveSheet.Cells(c, 1).Value = Item And ActiveSheet.Cells(c, 3) = "Adult" Then d = d + 1 ElseIf ActiveSheet.Cells(c, 1).Value = Item And ActiveSheet.Cells(c, 3) = "Student" Then s = s + 1 End If data(f, 1) = Item data(f, 2) = d data(f, 3) = s 'data(f, 4) = ActiveSheet.Cells(c, 5).Value Next For c = 1 To 669 If ActiveSheet.Cells(c, 1).Value = Item Then data(f, 4) = ActiveSheet.Cells(c, 5).Value End If Next d = 0 s = 0 Next Item ListBox1.List = data - David |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Rekey data faster | Excel Discussion (Misc queries) | |||
faster way of data entry | New Users to Excel | |||
Loading Column Data with blank Rows into Data Validation Box | Excel Worksheet Functions | |||
Can faster CPU+larger/faster RAM significantly speed up recalulati | Excel Discussion (Misc queries) | |||
Loading Excel Array from VB Array Faster | Excel Programming |