Professional Documents
Culture Documents
Tab
Tab
Also check online for an ASCII table, so you can use the CHR function (for example,
using chr(32) for space, etc - you can even use these character codes for action
keys like escape (chr 27) and so on). Just in case again, here's a link:
--------------LISTBOX----------
As mentioned above, we can have our user select one, or more items in a ListBox.
The procedure below take a single selected ListBox item and places it into a range
at the bottom of a list.
Sheet2.Range("A65536").End(xlUp)(2, 1) = ListBox1.Value
For such code to work the ListBox must have its MultiSelect Property set to 1
fmMultiSelectSingle
When have set the MultiSelect Property set to -1 fmMultiSelectMulti we can allow
users to make multiple selections. However, due to MultiSelect Property set to -1
fmMultiSelectMulti we can no longer use simple code like above to return the
selected items to our cells. To do this with multiple selections we can use code
like shown below;
Sheet2.Range("A65536").End(xlUp)(2, 1) = ListBox1.List(lItem)
ListBox1.Selected(lItem) = False
End If
Next
End Sub
-----------------------------------------------------
Dim iIndex
Dim iInd2
With lboMICHNAME
iIndex = lboMICHNAME.ListIndex
lboMICHsummary.AddItem .List(iIndex, 0), 0
iInd2 = lboMICHsummary.ListCount - 1
For x = 1 To lboMICHNAME.ColumnCount - 1
lboMICHsummary.List(iInd2, x) = .List(iIndex, x)
Next x
End With
----------------
Sub SortAndRemoveDupes()
Sheet1.Range("A1", Sheet1.Range("A65536").End(xlUp)).Clear
rOldList.AdvancedFilter Action:=xlFilterCopy, _
With rListSort
End With
("A2", Sheet1.Range("A65536").End(xlUp)).Address
With UserForm1.ListBox1
.RowSource = vbNullString
.RowSource = strRowSource
End With