|
Visual Basic (VB and VBA) |
|
Copyright 1999-2001 Christopher Greaves. All rights reserved. Home Page and email to [email protected] |
| If in doubt, record a macro and inspect the entrails! |
Please read the DISCLAIMER.
Here is an INDEX to all the procedures.
You will probably need one copy of my GLOBAL DECLARATIONS.
Public Function LoadArrayToListBoxKLW(strAr() As String, lb As ListBox, i1 As Integer, i2 As Integer, i3 As Integer, Optional blnCaseSensitive As Boolean = True)
' Procedure : LoadArrayToListBoxKLW
' Description: Load only unique items from the array to the ListBox.
' By: Chris Greaves Inc.
' Inputs: String array, Listbox, 3 integer Column numbers, case sensitive switch.
' Returns: None.
' Assumes: Nothing
' Side Effects: None
' Tested: By the calls shown below.
Dim strAdd As String
Dim strOld As String
lb.Clear
strAdd = strUnPackIKLW(strAr(0), strcArrayDelimiter, i1, i2, i3)
lb.AddItem strAdd
strOld = strAdd
Dim lngRow As Long
For lngRow = 1 To UBound(strAr)
Call strStatusBar("Loading " & strFmt0dec(lngRow) & " of " & strFmt0dec(UBound(strAr)) & " entries")
strAdd = strUnPackIKLW(strAr(lngRow), strcArrayDelimiter, i1, i2, i3)
If blnCaseSensitive Then
If strOld = strAdd Then ' found a duplicate on this column-key
Else ' Not a duplicate; copy it back to the combo.
strOld = strAdd
lb.AddItem strAdd
End If
Else
If UCase(strOld) = UCase(strAdd) Then ' found a duplicate on this column-key
Else ' Not a duplicate; copy it back to the combo.
strOld = strAdd
lb.AddItem strAdd
End If
End If
Next lngRow
End Function
| We all knew nothing when we started … |
|
Home Page and Contact Information Send email to [email protected]. This page was last updated Thursday, November 15, 2001 |