yc = ListBox1.BackColor '³o¥H¤U¬°Listbox1¡BListbox2ªºµ{¦¡
wc = TextBox1.BackColor
Set d1 = CreateObject("Scripting.Dictionary")
Set d2 = CreateObject("Scripting.Dictionary")
With Sheets("¸ê®Æ®w")
.Unprotect Password:="69123"
rng = .[A1].CurrentRegion
End With
For r = 2 To UBound(rng)
mycase = "-" & rng(r, 2)
If Trim(rng(r, 1)) <> "" Then
myname = Trim(rng(r, 1))
br = r
d1(myname) = r & "-" & r
Else
d1(myname) = br & "-" & r
End If
d2(myname & mycase) = r
Next r
UserForm2.ListBox1.List = d1.KEYS
UserForm2.CommandButton11.SetFocus '³o¥H¤W¬°Listbox1¡BListbox2ªºµ{¦¡
Private Sub UpdateBox()
d1.RemoveAll <-------------------------------------------------------------------------------------------------³o¤@¬qµ{¦¡¤Ï¶À
d2.RemoveAll
rng = Sheets("Sheet1").[A1].CurrentRegion
For r = 2 To UBound(rng)
mycase = "-" & rng(r, 2)
If Trim(rng(r, 1)) <> "" Then
myname = Trim(rng(r, 1))
br = r
d1(myname) = r & "-" & r
Else
d1(myname) = br & "-" & r
End If
d2(myname & mycase) = r
Next r
UserForm2.ListBox_4.List = d1.keys
End Sub§@ªÌ: GBKEE ®É¶¡: 2013-7-16 18:33