返回列表 上一主題 發帖

[發問] (己解決!)~~有關以下2個不明白的問題.想請教各位指導一下小弟!

回復 3# StanleyVic
Q1 :沒程式碼如何修正
Q2:你描述的不清楚

TOP

本帖最後由 GBKEE 於 2011-8-9 19:10 編輯

回復 5# StanleyVic
Q2: 試試看是這樣嗎?
  1. Option Explicit
  2. Dim Ar(), At
  3. Private Sub ListBox1_Click()
  4.     TextBox1 = ListBox1.List(ListBox1.ListIndex)
  5. End Sub
  6. Private Sub TextBox1_Change()
  7.     At = Filter(Ar, TextBox1.Text, True)
  8.     If UBound(At) > -1 Then
  9.         ListBox1.List = At
  10.     Else
  11.         ListBox1.List = Ar
  12.     End If
  13. End Sub
  14. Private Sub UserForm_Initialize()
  15.     Ar = Application.WorksheetFunction.Transpose(Sheet1.Range("A:A").SpecialCells(xlCellTypeConstants))
  16.     'A欄是資料區(資料區須是連續範圍)
  17. End Sub
複製代碼

TOP

回復 7# StanleyVic
Q1: 改為如此試試看
  1. Private Sub MultiPage1_Change()
  2.     If MultiPage1.Value = 1 Then
  3.         With ListView1
  4.             .Gridlines = True
  5.             .View = lvwReport
  6.             .ColumnHeaders.Add , , "Searching Result ...", 180
  7.         End With
  8.     End If
  9. End Sub
複製代碼
Q2:
  1. Private Sub TextBox1_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
  2. If TextBox1.Value <> "" Then
  3.         ListBox1.Visible = True
  4.         At1 = Filter(Ar1, TextBox1.Text, True)
  5.         ListBox1.List = At1
  6.     Else
  7.         ListBox1.Visible = False
  8.     End If
  9. End Sub
複製代碼

TOP

        靜思自在 : 時時好心就是時時好日。
返回列表 上一主題